Re: [xsl] Collapsing run-on tag chains not working in saxon or xalan

Subject: Re: [xsl] Collapsing run-on tag chains not working in saxon or xalan
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 1 Nov 2004 21:01:55 GMT
> With the following xml and xsl, the Microsoft msxmldom 4 is producing
> the expected output, but xalan 2.4, 2.6, and saxon 6.5.3 are not: they
> all produce the same, unexpected output.
actually, you could have skipped the rest of your message:-)

mxsml has a "feature" that it "helpfully" removes white space text nodes
from the input so they do not appear at all in the tree that xslt works
on.
If you are calling it from an API you can set the preservewhitespace
property (with some capitals somewhere) so that this does not happen.

You have white space indenting your elements and you usse
following-sibling::node()  so when you go

		<xsl:if
		test="not(local-name(preceding-sibling::node()[1])='ilink')">

on a conformant processor the following sibling is a text node, so
doesn't have a name and your test does what you called "unexpexted"
output bu



to fix this use ::* not ::node() so you are only looking for elements or
use xsl:strip-space elements="*"  (or just elements="ilink" )
so that white space nodes are ignored.

Then you'll get the same results everywhere (untested)

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread