Source XML:
<record>
<protein>AAA</protein>
<reference>1234</reference>
<reference>679</reference>
</record>
<record>
<protein>BBB</protein>
<reference>9876</reference>
</record>
<record>
<protein>CCC</protein>
<reference>9876</reference>
<reference>14846</reference>
<reference>982</reference>
</record>
I am new at using XLST and have been unable to find a solution to my problem. I need to specifically create an XML file where the data in a record is split out into one or more new records based upon the values in a list. Please note that the number of values in the list (reference) is highly variable.
Desired XML:
<record>
<protein>AAA</protein>
<reference>1234</reference>
</record>
<record>
<protein>AAA</protein>
<reference>679</reference>
</record>
<record>
<protein>BBB</protein>
<reference>9876</reference>
</record>
<record>
<protein>CCC</protein>
<reference>9876</reference>
</record>
<record>
<protein>CCC</protein>
<reference>14846</reference>
</record>
<record>
<protein>CCC</protein>
<reference>982</reference>
</record>
Any help is much appreciated.