Oxygen XML Editor
 
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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
 
© 2002-2008 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy
This website was created & generated with <oXygen/> XML Editor