XSD Code Generator [closed]

浪尽此生 提交于 2019-11-27 01:22:14

问题


Are there any Code Generators that would take a well-formed XML document, and write out an XSD schema based on how the XML document is structured?


回答1:


The XSD.exe utility (which is installed with Visual Studio) is capable of creating an XSD file from an XML file.

Here's the link on MSDN

I believe it may also part of the .NET SDK, meaning you would not need a full-blown Visual Studio installation.




回答2:


Best Answer, bar none:

http://xsd2code.codeplex.com

I pulled my hair out for a full 8 hr work day, got nowhere with all the crappy solutions out there (XSD, CodeXS, XSDObjectGen, and others) and am not interested in paying $400 for the stupid commercial tools just to do this.

Then I came across this codeplex project... WOW! Where was this all my life?

And the best part... its actively being worked on, right NOW (2009), not an abaondoned crust pile from 2004 or some lame thing.

Enjoy!




回答3:


Visual Studio does it pretty well too... Open XML file.. Choose 'Generate Schema' Command from XML menu




回答4:


I am a little late to the part, but I find that Businessware Architects CodeXS is very good. I have found that it handles complex schema's much better.




回答5:


I'm note sure it is useful. After all, it cannot infer everything: if an element is present in the XML document, how to know if it is mandatory or not?

Examplotron, to achieve a similar goal, relies, at least partly, on annotations.




回答6:


Try XXSd2Code. It code generates C#, C++, Java and C++/CLI bindings from xsds. XXSd2Code




回答7:


And old question I know but this might help someone: http://www.freeformatter.com/xsd-generator.html. Simple online tool and gets the job done with ease. Perfect for quick XML schema generation.



来源:https://stackoverflow.com/questions/288236/xsd-code-generator

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