I need a tool to automatically generate an xsd from an xml file.
Are there tools that do this? How does it work?
Thanks!
Most "big" XML editors boast this feature but in my experience, none can really deliver. The last time I tried (yesterday), Altova XML Spy generated crap.
But there is a deeper problem to automated schema generation from XML. In most cases, your Schema will be tied to the one file it was generated from, as the generator is unaware of all the restrictions and defaults you need to have a usable, flexible and safe schema.
There are some tools that could make the creation of Schema really easy. You can start with a visual editor like Liquid XML Studio -it has the nicest visual Schema editor I have seen.
Disclaimer : I am in no way affiliated to Liquid Technologies :)
There are several tools such as Altova.
If you would like to do this command line or in code trang is a good option.
精彩评论