4

I need to make the above equation comes true!

I have an XML file with its XSD schema, and I need to get the Java classes with the required code to parse the XML file and construct java objects..

I am asking here about a standard (or defacto like apache) utility to make the above request comes ture....

Is JAXB can make this happens?

Thanks.

2 Answers 2

4

Sounds like you want JAX-B, the Java XML-to-object binding API.

Sign up to request clarification or add additional context in comments.

3 Comments

Does JAX-B do the required XML parsing staff to populate the objects?
Yes, it does. This is your cue to read some of the docs instead of being spoon-fed here. Start with this: jaxb.dev.java.net/tutorial/section_1_3-Hello-World.html#Hello World
+1 Also since JAXB is a standard there are multiple implementations check out EclipseLink JAXB (MOXy): eclipse.org/eclipselink/moxy.php and my blog: bdoughan.blogspot.com for even more examples.
0

You need a library to compile the xsd into Java types. JAXB and XMLBeans are two such libraries.

With XMLBeans you can run a simple command to generate the Java types:

scomp -out types.jar myschema.xsd

1 Comment

The JAXB command line is also simple: xjc -d out myschema.xsd

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.