I want to merge 2 XMLs based on a particular condition.
e.g: Sample1.xml:
<rootNode>
<header>
<title agg="sum">1</title>
<records agg="sum">10</records>
<number agg="min">5</number>
<header>
</rootNode>
Sample2.xml
<rootNode>
<header>
<title agg="sum">2</title>
<records agg="sum">20</records>
<number agg="min">15</number>
<header>
</rootNode>
I want that these two xml files should be merged based on the attribute specified within the tag i.e "agg".if agg="sum" then title from sample1.xml and sample2.xml should get added. Output should be like:
output.xml
<rootNode>
<header>
<title agg="sum">3</title>
<records agg="sum">30</records>
<number agg="min">5</number>
<header>
</rootNode>
Kindly provide XSLT for this. Thanks.