Archive

Archive for the ‘xml’ Category

Create XSD from XML file

September 1, 2010 Leave a comment

I recently required to generate XSD file from XML file,

To accomplish this i used built in tool provided in Visual studio itself,

What you need to do is open your xml file, as you open xml file IDE will show up with new option tab available to generate xsd file option.

Also you can do this from command prompt, there is a xsd.exe file located at

C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin or C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin,

set this path to command prompt then you can set any below option and it will generate xsd file,

xsd.exe <schema>.xsd /classes|dataset [/e:] [/l:] [/n:] [/o:] [/s] [/uri:]

xsd.exe <assembly>.dll|.exe [/outputdir:] [/type: […]]

xsd.exe <instance>.xml [/outputdir:]

xsd.exe <schema>.xdr [/outputdir:]

Reference: here

Categories: asp.net, xml Tags: , ,