[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Numbering: position() ?
1. The value of position() within an xsl:template depends on the position of the node within the set of nodes selected by the select expression of the corresponding xsl:apply-templates, which you haven't shown us. 2. You don't say what numbering you would consider correct. If you're looking for multi-level numbering, try <xsl:number level="multiple"/>. If you want single-level numbering, consider <xsl:number level="any"/>. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: Sven Waibel [mailto:sven.waibel@xxxxxxxx] > Sent: 10 January 2007 10:41 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Numbering: position() ? > > Hi, > > i got following xml: > > <book id="1"> > <page> > <special> > <page> > <page> > </special> > <page> > <page> > </book> > > xslt: > > > <xsl:template match="page"> > <xsl:value-of select="concat(concat(ancestor::book/$id, > '.'), position())"/> </xsl:template> > > I got this numbering: > 1.1 > 1.1 > 1.2 > 1.3 > 1.4 > > How can i achieve that the numbering is correct? > > Thanks > Sven
|
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
|