I have a simple XML with two levels (Header and Line) of tags such as:
<?xml version="1.0"?>
<Header>
<line>Line 1</line>
<line>Line 2</line>
<line>Line 3</line>
<line>Line 4</line>
<line>Line 5</line>
<line>Line 6</line>
<line>Line 7</line>
<line>Line 8</line>
<line>Line 9</line>
</Header>
I need to group the lines on sets of X (X=3 for example) lines so that my output is the following:
<?xml version="1.0"?>
<Header>
<set>
<line>Line 1</line>
<line>Line 2</line>
<line>Line 3</line>
</set>
<set>
<line>Line 4</line>
<line>Line 5</line>
<line>Line 6</line>
</set>
<set>
<line>Line 7</line>
<line>Line 8</line>
<line>Line 9</line>
</set>
</Header>
How do I write a XSLT that can do this kind of transformation?
Thanks!
O