| Author |
How to increment a value in xsl?
|
Viswanathan Ramasamy
Greenhorn
Joined: Nov 14, 2005
Posts: 23
|
|
hi all, I want to increment a valu in xsl. Code : 1 <xsl:variable name="uniqueID_Address1" select="'0'"/> 2 <xsl:for-each select="Z"> 3 <xsl:if test="@n=$uniqueID"> 4<xsl:value-of select="$uniqueID_Address1=$uniqueID_Address1+1"/> 5 </xsl:if> I'm getting false in line no 4.
|
With Regards<br />Viswa
|
 |
Aryan Khan
Ranch Hand
Joined: Sep 12, 2004
Posts: 289
|
|
Viswanathan, You can not change the variable value in XSL not like the other languages. Try using recursion Regards Ahmad
|
OCP/MCP/SCJP/SCWCD/IBM XML/SCMAD/SCEA-1
|
 |
Aryan Khan
Ranch Hand
Joined: Sep 12, 2004
Posts: 289
|
|
Viswanathan, You can not change the variable value in XSL not like the other languages. Try using recursion Regards Ahmad
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
XSLT is not a procedural language like Java, it is a functional language. And it has a lot of functions (courtesy of XPath) that allow you to write it that way. So something like:is the replacement for those 5 lines.
|
 |
 |
|
|
subject: How to increment a value in xsl?
|
|
|