xsl-list
[Top] [All Lists]

Re: [xsl] Insert running number with special start value

2007-08-31 07:45:40
On 8/31/07, Meyer, Roland <roland(_dot_)1(_dot_)meyer(_at_)nsn(_dot_)com> wrote:
Hi,

I could not find a solution for my question in the FAQs, although I
think it could be trivial.

I have an XSL with a for-each loop and like to place a running number
into my output xml.

I could do this successful by using the following code:

   <xsl:for-each select="MyTag">
   ...
      <xsl:element name="running_number"><xsl:number/></xsl:element>
   ...
   </xsl:for-each>

It starts with value 1 and counts up till the loop ends.

But now I like to start with e.g. value 900 and not with value 1. What
is the easiest way to do this (the number attributes seem not to support
such thing)?

<running-number>
  <xsl:value-of select="900 + position()"/>
</


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>