I have some XML which contains records and sub records, like this:
<data>
<record jsxid="id0x0b60fec0" ID="12429070" Created="2008-10-21T03:00:00.0000000-07:00">
<record jsxid="id0x0b60ff10" string="101"/>
<record jsxid="id0x0e64d8e8" string="63"/>
<record jsxid="id0x2fd83f08" string="Y"/>
</record>
<record jsxid="id0x0b60fec0" ID="12429070" Created="2008-10-21T03:00:00.0000000-07:00">
<record jsxid="id0x0b60ff10" string="102"/>
<record jsxid="id0x0e64d8e8" string="77"/>
<record jsxid="id0x2fd83f08" string="Y"/>
</record>
<data>
I need to transform it so that the string attribute of the sub records are brought up into the parent record as consecutively numbered attributes and then discarded, like this:
<data>
<record jsxid="id0x0b60fec0" ID="12429070" Created="2008-10-21T03:00:00.0000000-07:00" 1="101" 2="63" 3="Y"/>
<record jsxid="id0x0b60fec0" ID="12429070" Created="2008-10-21T03:00:00.0000000-07:00" 1="102" 2="77" 3="Y"/>
<data>
The number of sub-records is arbitrary across documents but remains static within the same document.
Would someone be so kind as to point the way to an XSLT solution? Many thanks.