2

Is there a way to generate an xsd from an xml file? Are there any class files that do this? I don't mind if the solution is c# or java.

I would like to do this in code, but if there are any good free tools that would be ok too.

Thanks

Paul
  • 19,704
  • 14
  • 78
  • 96
Tim
  • 169
  • 5
  • 15

2 Answers2

3

xsd.exe can do what you want:

If you specify an XML file (.xml extension), Xsd.exe infers a schema from the data in the file and produces an XSD schema. The output file has the same name as the XML file, but with the .xsd extension.

Anton Gogolev
  • 113,561
  • 39
  • 200
  • 288
  • See to find xsd.exe on your machine: http://stackoverflow.com/questions/1073228/i-cant-find-xsd-exe-in-visual-studio-2008 – guiomie Dec 06 '12 at 04:09
2

Try xsd command better explained at XML Schema Definition Tool (Xsd.exe)

Nasmi Sabeer
  • 1,370
  • 9
  • 21