Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tool to generate xml file from xsd (for testing) [closed]

Tags:

c++

xml

xsd

I have an xsd file and have not done much xml manipulation, parsing, etc. I want/need test xml files for my code but don't have any samples. (I am using xerces to parse)

This is similar to: xml-instance-generation-from-xml-schema-xsd

but I don't really want to make it a two step process. (python or java)

I just want to feed xsd file to some tool and have it generate a sample xml file. How can I do that?

Also see: how-to-generate-sample-xml-documents-from-their-dtd-or-xsd

like image 674
Tim Avatar asked Apr 17 '09 18:04

Tim


3 Answers

Eclipse has tools for doing this (and it's free.)

EDIT (yeah, I was a little too terse) : What you want are the XSD editing tools in Eclipse. I know it's bundled with Eclipse IDE for Java EE Developers, and I think also with the Eclipse Modeling Tools download. (It's also possible to add them into an existing Eclipse install, though I don't know exactly which plugin(s) you'll want to add.)

(I'd like to be more precise than that, but the eclipse.org web site models itself after Massachusetts roads: If you don't know where you are, you don't belong there.)

Anyway: Once you've got the right version of Eclipse, open the existing schema file for editing (or create a new one: select File -> New... Other ... XML / XML Schema ). When you're ready to generate a test XML file, locate the file in the Package Explorer (the navigator view, usually on the left side), right click on it, and select Generate/XML File.

(What was I saying about navigability... ?)

like image 136
Dan Breslau Avatar answered Nov 12 '22 10:11

Dan Breslau


Microsoft has published a "document generator" tool as a sample. This is an article that describes the architecture and operation of the sample app in some detail.

If you just want to use the doc generation tool, click here and install the MSI.

It's free. The source is available. Requires the .NET Framework to run. Works only with XSDs. (not Relax NG or DTD).

like image 33
Cheeso Avatar answered Nov 12 '22 10:11

Cheeso


Oxygen's XML Schema Editor can generate sample XML instance documents from a given Schema.

like image 5
Lyle Avatar answered Nov 12 '22 09:11

Lyle