This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Increment a Value in xsl:for-each
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] Increment a Value in xsl:for-each
- From: "Raj Avula" <raj_avula at hotmail dot com>
- Date: Thu, 8 Mar 2001 12:54:26 -0800
- References: <003301c0a803$9e8af910$d6a8a8c0@monsterdaata.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi,
I am using xsl:for-each to read all the nodes with the same name at the
same level in my xml file.
I have to actually read two nodes at one time.
eg:
<Customer>
<Address/>
<Address/>
<Address/>
<Address/>
<City/>
<City/>
<City/>
<City/>
</Customer>
In xsl:for-each I have to read first Address and First City for the first
time,
Second Address and second City second time and so on.
My XSL template is
<xsl:variable name="iCount" select="1"/>
<xsl:for-each select="Address">
<xsl:value-of select="Address"/>
<xsl:value-of select=../City[position()=$iCount"/>
</xsl:for-each>
I have to increment iCount in for loop.
Can you please tell me how can I increment iCount in for-each loop.
Thanks,
Raj
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list