tags:

views:

34

answers:

0

Hi,

I have the following xml:

<Subscriptions>
 <Subscription>
  <Uplink>
   <Size>15</Size>
   <Unit>Mbps</Unit>
  </Uplink>
  <Name>Class D</Name>
 </Subscription>
 <Subscription>
  <Uplink>
   <Size>10</Size>
   <Unit>Mbps</Unit>
  </Uplink>
  <Name>Class A</Name>
 </Subscription>
 <Subscription>
  <Downlink>
   <Size>50</Size>
   <Unit>Mbps</Unit>
  </Downlink>
  <Name>Class B</Name>
 </Subscription>
 <Subscription>
  <Uplink>
   <Size>10</Size>
   <Unit>Mbps</Unit>
  </Uplink>
     <Name>Class B</Name>
 </Subscription>
 <Subscription>
  <Downlink>
   <Size>40000</Size>
   <Unit>Mbps</Unit>
  </Downlink>
  <Name>Class A</Name>
 </Subscription>
 <Subscription>
  <Downlink>
   <Size>20</Size>
   <Unit>Mbps</Unit>
  </Downlink>
  <Name>Class C</Name>
 </Subscription>
 <Subscription>
  <Downlink>
   <Size>45</Size>
   <Unit>Mbps</Unit>
  </Downlink>
  <Name>Class D</Name>
 </Subscription>
</Subscriptions>

I want to group it in the following format based on name using XSLT1.0. Please help

<?xml version="1.0" encoding="UTF-8"?>
<Subscriptions>
 <Subscription>
  <Downlink>
   <Size>45</Size>
   <Unit>Mbps</Unit>
  </Downlink>
  <Uplink>
   <Size>15</Size>
   <Unit>Mbps</Unit>
  </Uplink>
  <Name>Class D</Name>
 </Subscription>
 <Subscription>
  <Downlink>
   <Size>40000</Size>
   <Unit>Mbps</Unit>
  </Downlink>
  <Uplink>
   <Size>10</Size>
   <Unit>Mbps</Unit>
  </Uplink>
  <Name>Class A</Name>
 </Subscription>
 <Subscription>
  <Downlink>
   <Size>50</Size>
   <Unit>Mbps</Unit>
  </Downlink>
  <Uplink>
   <Size>10</Size>
   <Unit>Mbps</Unit>
  </Uplink>
     <Name>Class B</Name>
 </Subscription>
    <Subscription>
  <Downlink>
   <Size>20</Size>
   <Unit>Mbps</Unit>
  </Downlink>
  <Uplink>
   <Size>0</Size>
   <Unit>Mbps</Unit>
  </Uplink>
  <Name>Class C</Name>
 </Subscription>
</Subscriptions>

Thanks & Regards, D