Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] Subject: Counting Path Occurrences

From: "Michael Kay" <mike@------------>
To:
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/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent