none
Multi Level XML to Flat XML (Using XSLT)

    Question

  • This is the XML Source file :

    <ROOT>
     <RECORD>
      <A>
       <A>ValueA1</A>
      </A>
      <B>
       <B>ValueB1</B>
      </B>
      <B>
       <B>ValueB11</B>
      </B>
      <C>
       <C>ValueC1</C>
      </C>
      <D>ValueD1</D>   
     </RECORD>
     <RECORD>
      <A>ValueA2</A>
      <B>
       <B>ValueB2</B>
      </B>
      <B>
       <B>ValueB22</B>
      </B>
      <C>
       <C>VAlueC2</C>
      </C>
      <C>
       <C>ValueC22</C>
      </C>  
      <D>ValueD2</D>
     </RECORD>
     <RECORD>
      <A>
       <A>ValueA3</A>
      </A>
      <B>
       <B>ValueB3</B>
      </B>
      <B>
       <B>ValueB33</B>
      </B>
      <B>
       <B>ValueB333</B>
      </B>
      <C>
       <C>VAlueC3</C>
      </C>
      <C>
       <C>ValueC33</C>
      </C>
      <C>
       <C>ValueC333</C>
      </C>  
      <D>ValueD2</D>
     </RECORD>
    </ROOT>

    i need to convert into like below using XSLT ::

    <ROOT>
     <RECORD>
      <A>
       <A>ValueA1</A>
      </A>
      <B>
       <B>ValueB1</B>
      </B>
      <C>
       <C>ValueC1</C>
      </C>
      <D>ValueD1</D>
     </RECORD>
     <RECORD>
      <A>
       <A>ValueA1</A>
      </A>
      <B>
       <B>ValueB11</B>
      </B>
      <C>
       <C>ValueC1</C>
      </C>
      <D>ValueD1</D>
     </RECORD>
     <RECORD>
      <A>ValueA2</A>
      <B>
       <B>ValueB2</B>
      </B>
      <C>
       <C>VAlueC2</C>
      </C>
      <D>ValueD2</D>
     </RECORD>
     <RECORD>
      <A>ValueA2</A>
      <B>
       <B>ValueB22</B>
      </B>
      <C>
       <C>ValueC22</C>
      </C>
      <D>ValueD2</D>
     </RECORD>
     <RECORD>
      <A>
       <A>ValueA3</A>
      </A>
      <B>
       <B>ValueB3</B>
      </B>
      <C>
       <C>VAlueC3</C>
      </C>
      <D>ValueD2</D>
     </RECORD>
     <RECORD>
      <A>
       <A>ValueA3</A>
      </A>
      <B>
       <B>ValueB33</B>
      </B>
      <C>
       <C>VAlueC33</C>
      </C>
      <D>ValueD2</D>
     </RECORD>
     <RECORD>
      <A>
       <A>ValueA3</A>
      </A>
      <B>
       <B>ValueB333</B>
      </B>
      <C>
       <C>VAlueC333</C>
      </C>
      <D>ValueD2</D>
     </RECORD>
    </ROOT>

    Can any way put me right way.

    Thanks in advance.



    • Edited by Ram.BI Friday, March 16, 2012 10:18 AM
    Thursday, March 15, 2012 6:52 PM

Answers