-3

Possible Duplicate:
How to generate sample XML documents from their DTD or XSD?

Is there a tool out there that can take several XSD files and generate the corresponding XML files (all of them will generate the same "root element").

If there is none, but you know of any API's out there (specially Java or Python) please share them here. Examples would be nice too.

Thanks,

Community
  • 1
  • 1
elbuo
  • 106
  • 7
  • 2
    What do you mean by "corresponding XML files"? XSD files define schemas, not documents. – toniedzwiedz Jun 15 '12 at 12:36
  • An XSD can generate a XML file if you indicate a root element. I want an XML file that corresponds to that element defined in the XSD. – elbuo Jun 15 '12 at 12:37
  • 1
    Take a look at this duplicate question: [How to generate sample XML documents from their DTD or XSD?](http://stackoverflow.com/q/17106/851811) – Xavi López Jun 15 '12 at 12:39

2 Answers2

1

You can use JAXB to generate the needed java objects from your XSDs and marhsall/unmarshall the java objects to an xml file and vice-versa.

ChadNC
  • 2,528
  • 4
  • 25
  • 39
  • In order for me to extract the Java Objects I would need to create a class for each XSD. I'm dealing with over 1000 XSD's. I don't need any values inside of them. I just need to generate a sample XML for each one. But I must at least be able to specify the root element. – elbuo Jun 15 '12 at 13:16
  • Every XSD has its own root element. If all you want to do is just generate a sample xml file from each individual XSD then just go download a trial version of XMLSpy and use it to generate a sample XML file for you. – ChadNC Jun 15 '12 at 13:24
  • All of the XSD's I have have a root element called the same in each one. I've do generate my own XML's with Eclipse. But I want to automate this process. – elbuo Jun 15 '12 at 13:55
0

I believe the Apache Xerces project will do what you need.

I've not used the Java stuff before, but I've used the C++ bindings and the command line binaries in shell scripts.

http://xerces.apache.org/

Hugh Bothwell
  • 55,315
  • 8
  • 84
  • 99
shawty
  • 5,729
  • 2
  • 37
  • 71