|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] xsl:number with level=any
How exactly should the number be calculated in xsl:number when level=any?
In particular, are the context node and the node matching the "from"
expression both counted if they match the "count" expression?
The algorithm in the XSLT 2.0 draft seems to count both, and xsltproc
does this. Xalan and xt seem to not count the from node. I can't
work out what saxon is doing.
For concreteness, here is a stylesheet and a document. What should
the output be?
Stylesheet:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<doc>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
<xsl:text> </xsl:text>
</doc>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:attribute name="count">
<xsl:number level="any" count="x" from="/*"/>
</xsl:attribute>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Document:
<x>
<x/>
<x/>
</x>
-- Richard
|
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
|

Cart








