[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xsl:number with level=any

Subject: xsl:number with level=any
From: Richard Tobin <richard@xxxxxxxxxxxx>
Date: Wed, 13 Oct 2004 01:41:40 +0100 (BST)
xsl number 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>&#10;</xsl:text>
  <xsl:apply-templates/>
  <xsl:text>&#10;</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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.