I am new in XSLT and looking for help to remove duplicates of <EMP>
from an xml document on the basis of their children's combined value. From each group of elements with the same value for this, the one with highest value for AIB_Position/AIB
must be output. Below is my sample xml document and the corresponding desired output.
<Row_entry>
<Employees>
<Emp>
<Emp_id>E1</Emp_id>
<Emp_Name>Name1</Emp_Name>
<Country>C1</Country>
<AIB_Position>
<AIB>1500</AIB>
</AIB_Position>
</Emp>
<Emp>
<Emp_id>E2</Emp_id>
<Emp_Name>Name2</Emp_Name>
<Country>C2</Country>
<AIB_Position>
<AIB>1700</AIB>
</AIB_Position>
</Emp>
<Emp>
<Emp_id>E2</Emp_id>
<Emp_Name>Name2</Emp_Name>
<Country>C2</Country>
<AIB_Position>
<AIB>1800</AIB>
</AIB_Position>
</Emp>
</Employees>
</Row_entry>
Desired output(Removed duplicate Emp elements based on the combined <Emp_id>
, <Emp_Name>
, <Country>
value):
<Row_entry>
<Employees>
<Emp>
<Emp_id>E1</Emp_id>
<Emp_Name>Name1</Emp_Name>
<Country>C1</Country>
<AIB_Position>
<AIB>1500</AIB>
</AIB_Position>
</Emp>
<Emp>
<Emp_id>E2</Emp_id>
<Emp_Name>Name2</Emp_Name>
<Country>C2</Country>
<AIB_Position>
<AIB>1800</AIB>
</AIB_Position>
</Emp>
</Employees>
</Row_entry>