How do you increment or decrement a variable in XSL, when there is no upper or lower bound known? There exists a recursive solution explained in http://www.biglist.com/lists/xsl-list/archives/200403/msg00915.html
, but I am not talking about this. I don't want to just print the value of the variable given that its upper bound is 10 or 5 or whatever. I want to retain the value of the variable and use it to call other templates with parameters.
Rephrasing my problem in a more specific way: what I want to do is when there is a call to a certain template, a variable needs to be incremented (doesn't seem like this can be local to the template, but the incremented value may be passed as parameter). This incremented value is used to print something out. This template is not recursive but there's no problem to have a recursive counter template if it can work for this case.
An example of such a callee template is below. We use a parameter called 'sequence' to print a sequence number out in front of a printed XPath expression. However, this sequence number must be incremented every time the template "xpath" is called.
Thanks a lot in advance.