Java – Generate Java classes from .XSD files…

javaxmlxsd

I have a gigantic QuickBooks SDK .XSD schema file which defines XML requests/responses that I can send/receive from QuickBooks.

I'd like to be able to easily generate Java classes from these .XSD files, which I could then use to marshal XML to Java objects, and Java objects to XML.

Is there an easy way to do this…?

Ideally, it would not require any libraries external to the basic Java distro at run-time. But I'm flexible…

Best Answer

JAXB does EXACTLY what you want. It's built into the JRE/JDK starting at 1.6