Wednesday, May 12, 2010

Increment / decrement Variable in XSLT

There is no standard way to increment a variable in XSLT. variables in XSLT are immutable (Once a variable has been defined, it cannot be changed). 
instead we can use recursion combined with template parameters can achieve similar results.
here the part of the code i used to do decrement in XSLT.
Using a recursive call-template does the trick..
Basically we call a template from within one template with a parameter that is set
to the beginning of the increment.
call the same template, this time incrementing the value of the included parameter
by whatever you want by adding the necessary arithmetic within the select statemen
t.

No comments:

Post a Comment