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

incrementing a counter in XSL

Subject: incrementing a counter in XSL
From: becky.foley@xxxxxxxxxxxxxx
Date: Thu, 18 Apr 2002 14:05:37 -0400
becky foley
---------------------- Forwarded by Becky Foley/IIG/Prudential on
04/18/2002 02:05 PM ---------------------------
Becky Foley    Thursday April 18, 2002 12:13 PM
      (973) 802-6567
To:    XSL-List@xxxxxxxxxxxxxxxxxxxxxx
cc:
Subject:    incrementing a counter in XSL

I am selecting some nodes from an XML doc with an if statment in a for-each
loop.  Out of the set of nodes I am looping through, I am only selecting
some in the if statment.  Each of these nodes that is selected by the if
statement needs a sequence number.  Originally I was using :
     <xsl:for-each select="Contract/TermRdr">
            <xsl:if test="StatusCd='A' or StatusCd='F'">
                  <SequenceNum fieldType="Short" elementType
="field"><xsl:number value ="position()"/></SequenceNum>
            ....
      </xsl:if>
   </xsl:for-each>

but I realized I was getting the position from the source xml.  So if the
if statement selected 2 of the 5 nodes, they could end up with sequence
numbers 2 and 4 as opposed to the 1 and 2 I am looking for.

So now I am trying to figure out how to implement some sort of counter
within my if statement and use that variable, but I am struggling.

Can anyone help with the simple way to do this?

Thanks,







 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.