XSLT: generate multiple object by incrementing attribute and value
- by Daniel
Hi,
I have a xml as below that I'd like to copy n times while incrementing one of its element and one of its attribute.
XML input:
<Person position=1>
<name>John</name>
<number>1</number>
<number>1</number>
</Person>
and I'd like something like below with the number of increment to be a variable.
XML output:
<Person position=1>
<name>John</name>
<number>1</number>
</Person>
<Person position=2>
<name>John</name>
<number>2</number>
</Person>
....
<Person position=n>
<name>John</name>
<number>n</number>
</Person>
Any clue