What is the best way to compare elements of two large XML files with products?
For example: If one XML file contains a product
with the same id
as in a second XML file, I'd like to select the product which has newer date_added
and save it to new file.
Sample of my XML code:
<products>
<product id="1" date_added="2016-05-05">
<category><![CDATA[Category1]]></category>
<name><![CDATA[Product name]]></name>
<description><![CDATA[Description...]]></description>
<attributes>
<a name="Producent"><![CDATA[Producent]]></a>
<a name="PN"><![CDATA[12345]]></a>
</attributes>
</product>
</products>