My input data looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:queryResponse xmlns:ns1="http://abc.com/">
<ns1:result>
<ns1:records xmlns:ns2="http://def.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:Account">
<ns2:Id>2c</ns2:Id>
<ns2:Number>A722</ns2:AccountNumber>
</ns1:records>
</ns1:result>
</ns1:queryResponse>
I need to write a stylesheet which will create XML of the format:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="Account">
<xsd:sequence>
<xsd:element minOccurs="0" name="Id" type="xsd:string"/>
<xsd:element minOccurs="0" name="Number" type="xsd:string">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
The stylesheet should be able to create this XML?
The fields are also dynamically changing, so the stylesheet has to be generic so that it can extract the element name and value from the XML and create the output XML.