How to increment a variable in XSLT
Posted: Thu Nov 20, 2003 8:19 pm
Alright, I have the following code:
And I want to increase the count of the variable number after every loop through. How can I do this?
Code: Select all
<xsl:for-each select="flower">
<xsl:if test="@color = $Color">
<tr>
<td class="flower_info{$number}" style="border-right:1px solid #000000;">
<xsl:value-of select="name"/>
</td>
<td class="flower_info{$number}" style="border-right:1px solid #000000;">
<xsl:value-of select="id"/>
</td>
<td class="flower_info{$number}" style="border-right:1px solid #000000;">
<xsl:value-of select="description"/>
</td>
</tr>
</xsl:if>
</xsl:for-each>