I want your help to transform some XML to a new one using XSLT. I have the code of selecting multiple XMLs and applying on them the XSLT.
My problem is with the XSLT where I want to convert those shop1.xml shop2xml .. to allshops.xml. It is an easy task for someone who knows how to work with XSLT because there only 2-3 changes.
Below you can find the structures for better understanding. Thank you very much.
shop1.xml
<shop>
<products>
<product id="189">
<title></title>
<description></description>
<price></price>
<image></image>
<url></url>
<category id="61"></category>
</product>
</products>
</shop>
shop2.xml
<shop>
<products>
<product id="182">
<title></title>
<description></description>
<price></price>
<image></image>
<url></url>
<category id="62"></category>
</product>
</products>
</shop>
shop3.xml //this one has directly products as root and id might be already present
<products>
<product>
<id>123</id>
<title></title>
<description></description>
<price></price>
<image></image>
<url></url>
<category id="62"></category>
</product>
</products>
paths.xml it is used from the php code to get multiple xml files
<?xml version="1.0" encoding="utf-8"?>
<files>
<file>shop1.xml</file>
<file>shop2.xml</file>
<file>shop3.xml</file>
</files>
allshops.xml
<products> //removed the store,shop and products stays as root
<product>
<id>the product's attribute id</id> //new element, with value the product id=""
<title></title>
<description></description>
<price></price>
<image></image>
<url></url>
<category></category> //removed the attribute id
<shopid></shopid> //new element, will be blank for now
</product>
<product>
</product>
.
.
.
</products>