xsl-list
[Top] [All Lists]

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

2006-03-08 05:53:53
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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>