-1

Possible Duplicate:
XSD Code Generator

Hi,

I have alot of xml configurations. To precheck if the xml is valid I want to use an xsd file.

Is there some tool to create an xsd from an xml file. It doesn't have to be perfect or extremly strict about quantifiers etc. I would be happy if some vage skeleton could be created.

EDIT: For Eclipse.

Any ideas?

Community
  • 1
  • 1
Franz Kafka
  • 10,623
  • 20
  • 93
  • 149

2 Answers2

5

Visual Studio

If you open an XML file in Visual Studio (at home I'm using VS2008 Professional but I've also seen this work in VS2010 Web Developer Express) you can create an XSD for the file from the XML menu.

However, the created XSD is not very fancy and doesn't recognize exceptions or deviations but instead is a literal transscription of the XML's content. Writing the XSD manually for your XML content will almost certainly yield better results.

Nonetheless, the automatically created XSD can serve as a starting point or provide a quick validation option.

View of XML menu Created XSD

Community
  • 1
  • 1
Baelnorn
  • 940
  • 8
  • 17
2

For example:

Trang

Xsd.exe

If you use an IDE or an XML Editor, check if it does provide the functionality (perhaps with the help of a plugin).

Ekkehard.Horner
  • 38,498
  • 2
  • 45
  • 96