This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The Age-old question: Persisting POJOs to XML

 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Does this request even make any sense?
 
Paul Clapham
Sheriff
Pie
Posts: 20945
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic