Im new to xlst and am confused as to whether there is any way to store a value and change it later, for example incrementing a variable in a loop. variables in XSLT are immutable. Kindly help
For example I want to do something like this:
<xsl:for-each-group select="Values/value" group-by="xxx">
<xsl:variable name="cur" select="0" />
<xsl:for-each select="current-group()">
<xsl:if test="$cur=0 and flag !='0'">
<xsl:variable name="cur" select="$cur + 1" />
<!-- DO SOMETHING -->
</xsl:if>
</xsl:for-each>
</xsl:for-each-group>
flag node has 4 non zero record but need to display only one node. kindly help me to execute first occurrence of non zero record
XML:
<aa>....
<cc>
<Values>
<value>
<part>
<flag>0<flag>
<text></text>
...
...
</part>
<part>
<flag>0<flag>
<text></text>
...
...
</part>
<part>
<flag>1<flag>
<text></text>
...
...
</part>
</Value>
<value>
<part>
<flag>1<flag>
<text></text>
...
...
</part>
<part>
<flag>0<flag>
<text></text>
...
...
</part>
<part>
<flag>1<flag>
<text></text>
...
...
</part>
</Value>
</values>
</cc>
</aa>