Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a way in java to create xsd schema?

Tags:

java

xml

xsd

Is there a way in Java to create an XSD schema? I am trying to create a new schema .xsd file according to the number of attributes and their type given to me as input. Is there a package that can help me to do this job?

like image 777
user976749 Avatar asked Dec 08 '11 23:12

user976749


5 Answers

JAXB Schemagen can generate XSD Schema from Java Classes.

like image 145
scravy Avatar answered Oct 09 '22 17:10

scravy


try jlibs library. you can see you to create how to create xml schema using jlibs.xml.xsd.XSDocument at the end of the wiki

like image 20
Santhosh Kumar Tekuri Avatar answered Oct 09 '22 15:10

Santhosh Kumar Tekuri


Use the eclipse's xsd api has the ability to create, parse and update a xsd. Refer to their documentation for how-to details.

like image 20
Aravind Yarram Avatar answered Oct 09 '22 15:10

Aravind Yarram


With Apache XmlSchema you can construct XML schemata in-memory and convert them to string.

like image 42
Thresh Avatar answered Oct 09 '22 17:10

Thresh


In my project I've used the JAXB compiler to generate an object model "home made API" taking the XML schema as XJC input. You can find the file here: http://www.w3.org/2001/XMLSchema.xsd

Another solution is to use the Eclipse project MDT XSD (http://www.eclipse.org/modeling/mdt/?project=xsd#xsd) but I found it not well documented and easily integratable in a Maven build.

like image 40
Stefano Maioli Avatar answered Oct 09 '22 17:10

Stefano Maioli