问题
Is there an IDE out there that can generate XML from XSD? Not Oxygen or XmlSpy, they are too expensive for me... command line based is ofcourse the preferred method!
回答1:
The Netbeans IDE has a wizard for generating XML documents from an XSD schema. A nice thing is that you can also ask it to generate optional and repeating elements too.
回答2:
You can do it in the Eclipse Web Tools (included in the Eclipse IDE for Java EE Developers).
回答3:
How to generate sample XML documents from their DTD or XSD?
回答4:
Note that soon after this answer was originally posted, Apache XMLBeans was retired. As such, I cannot recommend it anymore. Anyway, I am still of the opinion that it had good command line support for generating example xsd:s, but a new release haven't been done in well over 2 years at time of writing.
command line based is ofcourse the preferred method!
In my opinion xsd2inst in the Apache XMLBeans is a very good tool for this. It is command line based and ships with binaries for Windows and Unix/Linux.
It is really simple to use too:
xsd2inst schemafile.xsd -name globalElementName
It generates the output directly to the console and can of course easily be piped to a file.
Is there an IDE out there that can generate XML from XSD?
IntelliJ Idea has the same functionality if using an IDE is prefered, even in the community edition. Just right click inside the xsd document and select Generate Instance Document From Schema, then select the root node.
回答5:
The .NET XML transform classes are pretty easy to use, so if you can't find something, it would be pretty easy to whip together a simple command line utility to do what you want.
回答6:
The free online XML editor XmlGrid.net has an option to generate XML from schema XSD. The nice thing is that you can specify how many repeatable elements you want and can fill the elements with the default values provided in your schema. It can handle very complicated schemas. Here is the url: http://xmlgrid.net
回答7:
I used this link: i use c#. but this is a simple step. Load the xsd, generate xml. It generates a sample xml for and element 3 times. http://www.codeproject.com/Articles/400016/Generate-Sample-XML-from-XSD?msg=4279868
回答8:
Useful online utility to Create XML Data From an XSD Schema File http://www.xsd2xml.com/
来源:https://stackoverflow.com/questions/428359/generate-xml-from-xsd