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:
'Variables' in XSL are actually constants - you cannot change their value. This:
will just output the value of $counter+1
To do loops you have to use recursion - e.g.:
altough it is better to try to avoid loops - in most cases the XSL can be written to avoid it, but I don't understand enough of what are you trying to achieve to give you the complete solution.