Link to home
Start Free TrialLog in
Avatar of rshk2001
rshk2001

asked on

XSL Grouping

Can you please let me know how to group below input file:

<root>
<group>
   <fInfo>21-21-02.xml</fInfo>
   <bInfo>21-21-02-01</bInfo>
</group>
<group>
   <fInfo>21-21-02-01.xml</fInfo>
   <bInfo>21-21-02-01-01</bInfo>
   <bInfo>21-21-02-01-02</bInfo>
   <bInfo>21-21-02-01-03</bInfo>
</group>
<group>
   <fInfo>21-21-02-01-03.xml</fInfo>
   <bInfo>21-21-02-01-03A</bInfo>
   <bInfo>21-21-02-01-03B</bInfo>
</group>
<group>
   <fInfo>21-21-02-01-04.xml</fInfo>
   <bInfo>21-21-02-01-04</bInfo>
</group>
<group>
   <fInfo>21-21-02-01-03.xml</fInfo>
   <bInfo>21-21-02-01-03C</bInfo>
   <bInfo>21-21-02-01-04A</bInfo>
</group>
</root>

to as below:

<?xml version="1.0" encoding="utf-8"?>
<root>
<group>
   <fInfo>21-21-02.xml</fInfo>
   <bInfo>21-21-02-01</bInfo>
</group>
<group>
   <fInfo>21-21-02-01.xml</fInfo>
   <bInfo>21-21-02-01-01</bInfo>
   <bInfo>21-21-02-01-02</bInfo>
   <bInfo>21-21-02-01-03</bInfo>
   <bInfo>21-21-02-01-04 <info>New data</info></bInfo>
</group>
<group>
   <fInfo>21-21-02-01-03.xml</fInfo>
   <bInfo>21-21-02-01-03A</bInfo>
   <bInfo>21-21-02-01-03B</bInfo>
   <bInfo>21-21-02-01-03C <info>New data</info></bInfo>
</group>
<group>
   <fInfo>21-21-02-01-04.xml</fInfo>
   <bInfo>21-21-02-01-04A <info>New data</info></bInfo>
</group>
<group>
   <fInfo>21-21-02-01-03.xml</fInfo>
</group>
</root>

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rshk2001
rshk2001

ASKER

Gertone! Apologies since I was away whereby I didnt checked my emails. Also, thanks for your solution and I will try to fit that into my requirements. As you said, true this is bit complicated the way the grouping is required. I appreciate your help.
Please accept https:#a36941614 as the answer. It does solve the grouping part completely.

After that response there is some noise, but that made me give some more explanation and references in https:#a36968349, that if you want you can make an assisted answer simply for the references