generate xsd from xml [duplicate]

丶灬走出姿态 提交于 2019-12-21 21:39:37

问题


I need a tool to automatically generate an xsd from an xml file.

Are there tools that do this? How does it work?

Thanks!


回答1:


There are several tools such as Altova.

If you would like to do this command line or in code trang is a good option.




回答2:


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 :)



来源:https://stackoverflow.com/questions/5885383/generate-xsd-from-xml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!