I am trying to do an XSLT transformation.
The XML input looks like this
<root>
<row>
<col1>John</col1>
<col2>2</col2>
<col3>Hello<col3>
<row>
<col1>John</col1>
<col2>3</col2>
<col3>Hello<col3>
<row>
<col1>Eddie</col1>
<col2>3</col2>
<col3>Hello<col3>
I am transforming XML data and opening it in Excel. I'm trying to create some sort of position counter in Excel. Each row indicates a person's file. Some files span multiple rows as shown above. What I want to create is a row position counter for each file. For example, John would have two rows of data in the excel sheet. I want one line to have the counter read "1" and the other line read "2". While, Eddie's position counter would only read "1".
What should I be looking at or trying to do?
If your data is already sorted, you might get away without grouping it. For example, given a well-formed test input:
the following stylesheet:
XSLT 1.0
will return:
Note: this is not a very fast method; if you have a very large data set, you may have to wait a bit.