Click here to Skip to main content
15,886,570 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to generate one XSD file through code.
Scenario is:
I have a dataset but when I use WriteXmlSchema it writes using default namespaces and prefixing all tags using "xs:".
But I want to generate a file like below sample

XML
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="" xmlns:prodata="urn:schemas-progress-com:xml-prodata:0001">
  <xsd:element name="DataSet1" prodata:proDataSet="true">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Table1" minOccurs="0" maxOccurs="unbounded">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="Col1" type="xsd:date" minOccurs="0" />
              <xsd:element name="Col2" type="xsd:int" minOccurs="0" />
              <xsd:element name="Col3" type="xsd:string" minOccurs="0" />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>


Please reply with a sample code.

Thanks,
Posted

1 solution

 
Share this answer
 
Comments
nishantkainth 3-Nov-11 3:29am    
Hello Anil,

This link only contains creating XML document(which is quite simple using .NET api's).
Actually I want some information on XSD's. Hope you have understood the problem I posted or am I missing something in the link you have posted :).

Regards,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900