Transform XML1 to XML2

Discussion in 'XML' started by dhanya_ct, May 14, 2012.

  1. dhanya_ct

    dhanya_ct

    Joined:
    May 14, 2012
    Messages:
    1
    Hi

    I have following xml input and need to convert to another XML format using XSLT . Please can some help me.

    <?xml version = "1.0" encoding = "UTF-8"?>
    <Inputs xmlns = "http://www.asd.com/schemas/Service/Schema.xsd">
    <row>
    <column>
    <name>CITY</name>
    <value>DELHI</value>
    </column>
    <column>
    <name>EMPID</name>
    <value>87676</value>
    </column>
    <column>
    <name>COMPANY</name>
    <value>xyz</value>
    </column>
    </row>
    <row>
    <column>
    <name>CITY</name>
    <value>MUMBAI</value>
    </column>
    <column>
    <name>EMPID</name>
    <value>97987</value>
    </column>
    <column>
    <name>COMPANY</name>
    <value>abc</value>
    </column>
    </row>
    <row>
    <column>
    <name>CITY</name>
    <value>DELHI</value>
    </column>
    <column>
    <name>EMPID</name>
    <value>76767</value>
    </column>
    <column>
    <name>COMPANY</name>
    <value>jhkjh</value>
    </column>
    </row>
    <row>
    <column>
    <name>CITY</name>
    <value>MUMBAI</value>
    </column>
    <column>
    <name>EMPID</name>
    <value>12334</value>
    </column>
    <column>
    <name>COMPANY</name>
    <value>nnbn</value>
    </column>
    </row>
    </Inputs>

    and I need to convert it to below xml format using xslt. How to achieve this output.

    <?xml version = "1.0" encoding = "UTF-8"?>
    <ns0:eek:utput xmlns:ns0 = "http://www.asd.com/schemas/Service/Schema.xsd">
    <ns0:Location>
    <ns0:City>MUMBAI</ns0:City>
    <ns0:Employee>
    <ns0:EMPID>97987</ns0:EMPID>
    <ns0:company>abc</ns0:company>
    </ns0:Employee>
    <ns0:Employee>
    <ns0:EMPID>12334</ns0:EMPID>
    <ns0:company>nnbn</ns0:company>
    </ns0:Employee>
    </ns0:Location>
    <ns0:Location>
    <ns0:City>DELHI</ns0:City>
    <ns0:Employee>
    <ns0:EMPID>87676</ns0:EMPID>
    <ns0:company>xyz</ns0:company>
    </ns0:Employee>
    <ns0:Employee>
    <ns0:EMPID>76767</ns0:EMPID>
    <ns0:company>jhkjh</ns0:company>
    </ns0:Employee>
    </ns0:Location>
    </ns0:eek:utput>
    Please somebody provide me the xslt to achieve the above output.

    Thanks in Advance
    Dhanya
     
    dhanya_ct, May 14, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hari

    chirpz transform in VHDL

    Hari, Jan 7, 2004, in forum: VHDL
    Replies:
    1
    Views:
    669
    tbx135
    Jan 9, 2004
  2. KathyB
    Replies:
    0
    Views:
    972
    KathyB
    Jun 24, 2003
  3. PJ
    Replies:
    1
    Views:
    972
    Kathy Burke
    Jun 25, 2003
  4. KathyB
    Replies:
    0
    Views:
    1,019
    KathyB
    Jun 25, 2003
  5. Showjumper
    Replies:
    0
    Views:
    633
    Showjumper
    Jul 3, 2003
Loading...

Share This Page