This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
following-sibling
- To: xsl-list at mulberrytech dot com
- Subject: following-sibling
- From: "Carole E. Mah" <carole at goon dot stg dot brown dot edu>
- Date: Tue, 14 Mar 2000 19:16:45 -0500 (EST)
- Reply-To: xsl-list at mulberrytech dot com
Suppose the input document consists of bad HTML, with naked CDATA directly
within BODY:
<body>
<p>this is ok</p>
<hr>
This is <b>bad</b>, naked CDATA, that even <i>Tidy</i> does not rectify.
<hr>
<p>this is also ok</p>
</body>
To surround the bad chunk with a <p>, you'd end up with:
...
<p>This is <b>bad</b>, naked CDATA, that even <i>Tidy</i> does not
rectify.</p>
To do this, one would expect to be able to match the first text()
following an OK block-level element (like <HR>, <P>, <H1> etc), do a
value-of for that node, and then do a copy-of every following-sibling()
that is a non-block element.
One would expect that "This is" is the first text() following the <HR>
and that <b>bad</b> is the first following-sibling, "naked CDATA that
even" is the second following-sibling ( of type text() ), <i>Tidy</i> is
the third following-sibling, and "does not rectify" is the fourth
following sibling (also of type text() ).
However, I have found that this is not the case -- XT/SAXON seem to
to think that the text() following-siblings are not actually siblings.
What I would think of as the second and fourth following-siblings of the
"This is" text() node ("naked CDATA that even" and "does not rectify")
are ignored by the processor, which thinks <b>bad</b> is the first
following-sibling of "This is" and <i>Tidy</i> the second, and ignores the
two intermingled text() nodes.
I know this is not too coherent, but if anyone can understand it, please
tell me where my mis-conception lies.
thanks!
-carole
- - - - - - - - - - - - - - - - - - - - - - - - -
Carole E. Mah Carole_Mah@Brown.edu
Senior Programmer/Analyst
Brown University Scholarly Technology Group
phn 401-863-2669
fax 401-863-9313
http://www.stg.brown.edu/
personal: http://www.stg.brown.edu/~carolem/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list