RE: [xsl] Counter variable

Subject: RE: [xsl] Counter variable
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 2 May 2007 18:25:39 +0100
> Am currently using postion () for displayin the numbers..
> 
> 
> <xsl:for-each select="//ITEM">
>  <xsl:value-of select="position()" />  <xsl:value-of 
> select="ITEM_DESC" /><br/> </xsl:for-each>

There's nothing wrong with using position(), it's often a good solution.

Three alternatives are:

(a) the xsl:number instruction

(b) expressions such as count(preceding-sibling::*)

(c) if generating HTML, generate an ordered list and leave HTML/CSS to do
the numbering

Michael Kay
http://www.saxonica.com/

Current Thread