0

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.

animuson
  • 53,861
  • 28
  • 137
  • 147
bharz629
  • 161
  • 2
  • 4
  • 10
  • What you want to achieve? Do you want to create an XSD on the basis of input XML? Is in this case you want to create schema for element with child element and ? – Navin Rawat May 30 '13 at 13:29
  • This has been answered [here](http://stackoverflow.com/questions/74879/) – Borodin May 30 '13 at 14:13
  • I want to create an xml which adheres to that schema.Like it should be of form 12 22 – bharz629 May 30 '13 at 14:24

0 Answers0