Subject:Param not incrementing Author:Retaw Gnirps Date:05 Aug 2009 04:16 PM
Hello,
I am currently trying to use the code below to increment the currentChild after every iteration. However, in the output shown below, it is apparent that the value is never changing.
There are four children in this example, so it is printing out the statements the correct number of times, just not incrementing the value.
What can I do to keep track of the currentChild count?
Thanks.
Code:
<xsl:param name="currentChild">0</xsl:param>
<xsl:for-each select="Attribute[./@name='Children.Name']/Value">
<xsl:value-of select="$currentChild"/> before increment<br/>
<xsl:with-param name="currentChild" select="$currentChild+1"/>
<xsl:value-of select="$currentChild"/> after increment<br/>
</xsl:for-each>
Output:
0 before increment
0 after increment
0 before increment
0 after increment
0 before increment
0 after increment
0 before increment
0 after increment