I have child element "Report_Entry" with sibling elements "employeeID, plan and startDate". I want to find distinct values using the sibling elements. If the combination of three elements is repeating, I want to eliminate any duplicate values.
I am not sure how to use distinct values based on multiple elements. I started going down the path of group-by by joining the strings and then split it once I get the group by value, but lost my way. group-by="string-join((employeeID,plan,startDate), '|')">
The XML data
<?xml version='1.0' encoding='UTF-8'?>
<Report_Data>
<Report_Entry>
<employeeID>0123</employeeID>
<plan>plan1</plan>
<startDate>2021-01-31</startDate>
</Report_Entry>
<Report_Entry>
<employeeID>0123</employeeID>
<plan>plan1</plan>
<startDate>2021-01-31</startDate>
</Report_Entry>
<Report_Entry>
<employeeID>0123</employeeID>
<plan>plan2</plan>
<startDate>2021-02-15</startDate>
</Report_Entry>
<Report_Entry>
<employeeID>0124</employeeID>
<plan>plan1</plan>
<startDate>2021-01-31</startDate>
</Report_Entry>
<Report_Entry>
<employeeID>0124</employeeID>
<plan>plan2</plan>
<startDate>2021-01-31</startDate>
</Report_Entry>
<Report_Entry>
<employeeID>0125</employeeID>
<plan>plan1</plan>
<startDate>2021-01-31</startDate>
</Report_Entry>
<Report_Entry>
<employeeID>0125</employeeID>
<plan>plan1</plan>
<startDate>2021-04-22</startDate>
</Report_Entry>
</Report_Data>
The output I am expecting. From the above output, employeeID 0123 with plan1 and startdat 0221-01-31 is repeating which I want to eliminate.
<?xml version='1.0' encoding='UTF-8'?>
<Report_Data>
<Report_Entry>
<employeeID>0123</employeeID>
<plan>plan1</plan>
<startDate>2021-01-31</startDate>
</Report_Entry>
<Report_Entry>
<employeeID>0123</employeeID>
<plan>plan2</plan>
<startDate>2021-02-15</startDate>
</Report_Entry>
<Report_Entry>
<employeeID>0124</employeeID>
<plan>plan1</plan>
<startDate>2021-01-31</startDate>
</Report_Entry>
<Report_Entry>
<employeeID>0125</employeeID>
<plan>plan1</plan>
<startDate>2021-01-31</startDate>
</Report_Entry>
<Report_Entry>
<employeeID>0125</employeeID>
<plan>plan1</plan>
<startDate>2021-04-22</startDate>
</Report_Entry>
</Report_Data>