I have the following XML code, and need to convert this to a .csv file. I don't need the whole xml file, but i have to select some xml tags.
<contract_Set>
<contract_period>
<reference>111111</reference>
<startperiod>2017-09-01</startperiod>
<endperiod>2017-09-06</endperiod>
<vehicle_Set>
<vehicle>
<vehicle_id>4444</vehicle_id>
<make>Mercedes-Benz</make>
</vehicle>
</vehicle_Set>
<invoice_Set>
<invoice>
<id>12345</id>
<description>Some text</description>
</invoice>
</invoice_Set>
<invoice_Set>
<invoice>
<id>12222</id>
<description>More text</description>
</invoice>
</invoice_Set>
</contract_period>
<contract_period>
<reference>222222</reference>
<startperiod>2017-09-01</startperiod>
<endperiod>2017-09-30</endperiod>
<vehicle_Set>
<vehicle>
<vehicle_id>55555</vehicle_id>
<make>Audi</make>
</vehicle>
</vehicle_Set>
<invoice_Set>
<invoice>
<id>45678</id>
<description>Audi text</description>
</invoice>
</invoice_Set>
</contract_period></contract_Set>
I need my output to be like:
Reference;Make;Invoice_Id;Invoice_Description
111111;Mercedes-Benz;12345;Some text
111111;Mercedes-Benz;12222;More text
222222;Audi;45678;Audi text
How can i do this with XSLT 1.0? I have searched for solutions in similar questions, but no success. I'm looking to select values of some tags, not all tags.
The following XSL will provide the desired output.
Output