I am having little difficulty in assigning a counter variable and incrementing it and then checking for a certain value in XSLT. Here is my code:
I have same problem. I need increment value in loop. So the simplest way was include Saxon and use that value.
if you use Saxon 6.5.5
if you use Saxon 9.4.0.4
And after that you can simply use saxon variable :