XSLT: Auto Incrementing a Variable
Recently, while utilizing XSLT for one of my projects, I came across this issue when I needed to auto-increment a variable for my records. After a bit of Google searching, I came across a somewhat usable method, which I improved upon to get this:
We first insert a node in our XSL under the node where we want the variable to be auto-incremented:
1 2 3 4 5 6 7 8 |
|
Now, we will actually be printing the value of this variable as below:
1
|
|