I need some help in editing a xml file, I have 2 xml files, One is Master.xml and other is a upgrade.xml. I want to moved all the values from upgrade.xml to Master.xml. challenge is upgrade.xml might have similar values, changed values and also new values.
So the script should find and replace or add in case its a new value. There should not be duplicate values.
upgrade.xml file
<test>
<test1>
<file name ="xyz">value1</file>
<file name ="abc">value2</file>
<file name ="kkk">value3</file>
</test1>
<folder name="ggg">
<new>
<file name="ppp"> value321 </file>
</new>
</folder>
</test>
Master.xml
<test>
<test1>
<file name ="ddd">value5</file>
<file name ="xyz">value0</file>
<file name ="abc">value2</file>
<file name ="mmm">value6</file>
</test1>
</test>
output file:
<test>
<test1>
<file name ="ddd">value5</file>
<file name ="xyz">value1</file>
<file name ="abc">value2</file>
<file name ="kkk">value3</file>
<file name ="mmm">value6</file>
</test1>
<folder name="ggg">
<new>
<file name="ppp"> value321 </file>
</new>
</folder>
</test>