[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Insert running number with special start value

Subject: Re: Insert running number with special start value
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Fri, 31 Aug 2007 15:45:38 +0100
Re:  Insert running number with special start value
On 8/31/07, Meyer, Roland <roland.1.meyer@xxxxxxx> 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/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.