I need to remove the duplicates from an XML file from bottom to top, Because I will be adding lot of projects(elements) to this XML file and I don't want the new value to be overwritten by old value.
In the following example, project "staticproperties" and febrelease2013 having two variables "prop1" and "prop2". But the latest values for these variables are from propject febrelease2013.
Is it possible always to copy the nodes from bottom to top.
In the following url the code is working fine, but it is coping from top to bottom.
remove duplicate nodes from xml file using xsl
Example:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<projects>
<project id="staticproperties">
<property name="prop1">old-value</property>
<property name="prop2">abc</property>
<property name="prop3">old-value</property>
<property name="prop4">def</property>
</project>
<project id="febrelease2013">
<property name="prop">abcd123</property>
<property name="prop1">new-value</property>
<property name="prop3">new-value</property>
<property name="prop5">defg</property>
</project>
</projects>
Expected output is:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<projects>
<project id="staticproperties">
<property name="prop2">abc</property>
<property name="prop4">def</property>
</project>
<project id="febrelease2013">
<property name="prop">abcd123</property>
<property name="prop1">new-value</property>
<property name="prop3">new-value</property>
<property name="prop5">defg</property>
</project>
</projects>