Altova Mailing List Archives>Archive Index >xsl-list Archive Home >Recent entries >Thread Prev - Re: [xsl] Subject: Counting Path Occurrences [Thread Next] RE: [xsl] Subject: Counting Path OccurrencesTo: Date: 4/4/2007 7:29:00 AM > > 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/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
