RE: selecting PCDATA elements

Subject: RE: selecting PCDATA elements
From: Avi Kivity <Avi@xxxxxxxxxxxxx>
Date: Sat, 17 Jul 1999 14:39:24 +0300
On Saturday, July 17, 1999 00:54, Weininger, Nicholas  (MN65)
[SMTP:weininger_nicholas@xxxxxxxxxxxxxxxxx] wrote:
> I've got a (probably simple) DSSSL question. I'm trying to process a
> certain
> element (defined in our custom DTD) which has a content model like:
> 
> <!ELEMENT element_foo - - (foo1, #PCDATA, foo2)>
> 
> and I want to select out just the #PCDATA for processing. So I want to do
> something like
> (process-node-list (select-elements (children (current-node)) "PCDATA"))
> 
> except that that doesn't work. (Nor does making it #PCDATA, removing the
> quotation marks, etc.)
> 
> How do I do this? *Can* I do this?
> 

Try replacing (select-elements ...) with (select-by-class (...) 'data-char).
(select-elements) returns only nodes of class element.
(It would probably be more correct to use (select-by-property (...) 'char
(lambda (x) #t) to grab the sdata's as well)

Mixed content is evil (you found one of the reasons). You may want to wrap
the #PCDATA in foo1.5.

---
"The only words which have meaning are the last ones spoken"



 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread