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:
If you want to know where you are in a for-each loop, you can use the built-in position() function.