[xsl] xsl:strip-space and position()

Subject: [xsl] xsl:strip-space and position()
From: "Jesper Tverskov" <jesper@xxxxxxxxxxx>
Date: Wed, 8 Mar 2006 13:53:30 +0100
Hi list,

In his book, XSLT 2.0, p. 409, Michael Kay mentions two reasons, why it is
often nice to use xsl:strip-space. I have problems with the last one:

"When the position() function is used to determine the position of an
element relative to its siblings, the whitespace-only text nodes are
included in the count. This often leads to the significant nodes being
numbered 2, 4, 6, 8, ..."

I understand this if we use "node()" as part of the XPath expression,
implicitly or explicitly, but in all cases, I can think of, when using the
position() function, we will always be more specific in order to include the
proper elements only.

Could someone give me a realistic markup example of the position() function
not working properly if xsl:strip-space is not used?

Best regards,
Jesper Tverskov

Current Thread