I would like to change the attribute of a very long xml as follows:
<element index="0">
<subelement bla="asdf" />
<subelement bla="asdf" />
</element>
<element index="1">
<subelement bla="asdf" />
<subelement bla="asdf" />
</element>
...
I need to add the N value of each index attribute. Say N = 5. The result is:
<element index="5">
<subelement bla="asdf" />
<subelement bla="asdf" />
</element>
<element index="6">
<subelement bla="asdf" />
<subelement bla="asdf" />
</element>
...
What is the easiest way to do this? I assume it will be with XSLT, but I do not know how to do this.
Thank!
source
share