Any tools to generate an XSD schema from an XML instance document? [closed]
the Microsoft XSD inference tool is a good, free solution. Many XML editing tools, such as XmlSpy (mentioned by @Garth Gilmour) or OxygenXML Editor also have that feature. They're rather expensive, though. BizTalk Server also has an XSD inferring tool as well.
edit: I just discovered the .net XmlSchemaInference class, so if you're using .net you should consider that
You can use an open source and cross-platform option: inst2xsd from Apache's XMLBeans. I find it very useful and easy.
Just download, unzip and play (it requires Java).
Trang is the best option here. Open source and cross platform (although Java is required)
From the Trang Website:
Trang converts between different schema languages for XML. It supports the following languages
- RELAX NG (XML syntax)
- RELAX NG compact syntax
- XML 1.0 DTDs
- W3C XML Schema
A schema written in any of the supported schema languages can be converted into any of the other supported schema languages, except that W3C XML Schema is supported for output only, not for input.
Trang can also infer a schema from one or more example XML documents.
Download Link
In VS2010 if you load an XML file into the editor, click the XML menu >> Create Schema.