I am new to the XSLT grouping concept. I am trying to group the below XML using XSLT 2.0 .
<Root>
<Entry>
<Split>
<Data>
<Num>20</Num>
<Type>A</Type>
</Data>
<Data>
<Num>20</Num>
<Type>A</Type>
</Data>
<Data>
<Num>20</Num>
<Type>A</Type>
</Data>
</Split>
<Split>
<Data>
<Num>20</Num>
<Type>B</Type>
</Data>
<Data>
<Num>20</Num>
<Type>B</Type>
</Data>
</Split>
<Split>
<Data>
<Num>21</Num>
<Type>C</Type>
</Data>
<Data>
<Num>21</Num>
<Type>C</Type>
</Data>
</Split>
</Entry>
</Root>
And below is my expected output.
<Root>
<Entry>
<Split>
<New_Tag>
<Data>
<Num>20</Num>
<Type>A</Type>
</Data>
<Data>
<Num>20</Num>
<Type>A</Type>
</Data>
<Data>
<Num>20</Num>
<Type>A</Type>
</Data>
</New_Tag>
<New_Tag>
<Data>
<Num>20</Num>
<Type>B</Type>
</Data>
<Data>
<Num>20</Num>
<Type>B</Type>
</Data>
</New_Tag>
</Split>
<Split>
<New_Tag>
<Data>
<Num>21</Num>
<Type>A</Type>
</Data>
<Data>
<Num>21</Num>
<Type>A</Type>
</Data>
</New_Tag>
</Split>
</Entry>
</Root>
I want to group 'Data' tags under 'Split'to 'New_Tag' if it has same 'Num' value in XSLT 2.0 . There will be more report entry. Please help me with this.
Is there ant way to this?
Thanks in advance.