Subject: [xsl] xsl:number with level=any From: Richard Tobin <richard@xxxxxxxxxxxx> Date: Wed, 13 Oct 2004 01:41:40 +0100 (BST) |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Creating Drop Caps with X, David Carlisle | Thread | RE: [xsl] xsl:number with level=any, Michael Kay |
Re: [xsl] Creating Drop Caps with X, David Carlisle | Date | [xsl] Multi-level grouping across m, Kent Seegmiller |
Month |