RE: [xsl] Numbering: position() ?

Subject: RE: [xsl] Numbering: position() ?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 10 Jan 2007 10:52:17 -0000
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: [xsl] 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

Current Thread