Creating XSD Files in Java

Is there a way (and not from / JAXB classes) to create XSD schemes in Java? I can parse it with some libraries, i.e. XSOM, Jdom, etc. But could not find anything to create.

+5
source share
4 answers

I do not know about an easy way to use. I considered using dom4j (because I use it for other purposes, but any other universal xml manipulation library is equivalent) and manually create it (1).

But then I realized that I could use JAXB to create an xml schema object model, populate it with what I wanted (it turned out to be much less convenient than I had hoped for) and marshall it (2). Its through JAXB, but without creating classes for your schema, so maybe this could be useful for you.

after 2 it is difficult (but not impossible) to create an invalid circuit, but sometimes it is difficult to determine how to create the circuit that I wanted. So I finished creating it in the editor, then parsed it and examined its representation of the object. In the end, creating it through 1) and then confirming it (which I should have done anyway) would be less time consuming.

+2
source
+2

You can use the Eclipse XSD project , which is part of the Eclipse model development tools. It provides a data model and API for programmatically creating schemas.

+1
source

To create XSD, you should use javaclasses / coding (this is inevitable):

Just use java DOMand create document, then the main one nodeand create another one nodesto join it and voila!

0
source

All Articles