Use a Counter Inside a For-Each Loop to Track the Number of Loop Iterations

You can use a counter inside a for-each loop to track the number of iterations processed by the loop. This task can be achieved with an xsl:variable through direct edit of the XSLT code.

For example:

See Edit XSLT Code in the Mapper.