I have an xml file which is updated every few hours by an e-commerce platform. I would like to generate a separate xml file with xpath filter.
XPath code is one line.
Which language should I use to generate that xml? Where can I find any template to make it work?
Ok, so i got that xml file:
<o id="17" url="url" price="15.00" avail="1" weight="0" stock="3" set="0"
basket="0">
<cat><![CDATA[ category ]]></cat>
<name><![CDATA[ name ]]></name>
<imgs><main url="url"/></imgs>
<desc><![CDATA[description]]></desc>
<attrs><a name="text"><![CDATA[ Dev ]]></a>
<a name="Code"><![CDATA[ ]]></a>
<a name="EAN"><![CDATA[ EAN ]]></a>
</attrs>
<o id="18" url="url" price="15.00" avail="1" weight="0" stock="3" set="0"
basket="0">
<cat><![CDATA[ category2 ]]></cat>
<name><![CDATA[ name ]]></name>
<imgs><main url="url"/></imgs>
<desc><![CDATA[description]]></desc>
<attrs><a name="text"><![CDATA[ Dev ]]></a>
<a name="Code"><![CDATA[ ]]></a>
<a name="EAN"><![CDATA[ EAN ]]></a>
</attrs>
There is many categories of products, but i need in seperate xml only products from "category2" with whole structure of the product. I found this to make this manually:
//o[normalize-space(cat) = 'category2']
Platform updating file every few hours with new products. So i would like to have script that download this file, automatically generate new xml with only category2.