• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to increment a value in xsl?

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 290
Oracle Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Viswanathan,

You can not change the variable value in XSL not like the other languages.

Try using recursion

Regards
Ahmad
 
Aryan Khan
Ranch Hand
Posts: 290
Oracle Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Viswanathan,

You can not change the variable value in XSL not like the other languages.

Try using recursion

Regards
Ahmad
 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic