This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I'm sure this question must have been asked a zillion times by now, but:
Given an XML Schema (.xsd) file, I'd like to generate a POJO that can be persisted to a compliant XML document. Are there any code generation tools that will help me do this? The perfect-world scenario would be an ANT task or something, that I could feed the url of the schema, and generate a JAVA class that I can persist (either using a generated persistence method, or else regular old Java persistence) to a schema-compliant XML document.
Yes, you're right, the question has been asked a zillion times. And it's been answered in the form of working implementations -- not quite a zillion times, but still quite a few times. Did you not find any of them in your searches? I assure you, there are several.
Joined: Mar 29, 2006
Thanks Paul. Yeah, I was figuring on using a JAXB Ant task, but all the articles I can find are at least five years old, and most don't show examples, or talk about "unarshalling Java Content Trees" and the like. Way over my head...
UPDATE: Finally figured out how to use the JAXB XJC task. Now just have to try and wire it up to my JAX-WS implementation...