Transform XML1 to XML2

Joined
May 14, 2012
Messages
1
Reaction score
0
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top