[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Subject: Counting Path Occurrences
> > Actually that function generates a sequence of text nodes. > > That was the original source of my confusion. :) Is that > because of the "for-each" over the ancestor-or-self axis? > The select clause of the for-each is irrelevant. It's because the content of the xsl:for-each is an xsl:value-of instruction. xsl:value-of constructs a text node, therefore xsl:for-each constructs several text nodes. If you use this construct inside another instruction such as a literal result element, then the several text nodes will be concatenated. But used directly within a function, there's no containing instruction to do the concatenation, so the sequence of text nodes is returned as is. Very often in 2.0 you should be using xsl:sequence rather than xsl:value-of. The difference is that xsl:sequence returns the result of its select expression unchanged, whereas xsl:value-of flattens it into a string and then wraps that string in a text node. Michael Kay http://www.saxonica.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|