File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes convert xml to java objects using JAXB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "convert xml to java objects using JAXB" Watch "convert xml to java objects using JAXB" New topic
Author

convert xml to java objects using JAXB

Raj Ohadi
Ranch Hand

Joined: Jun 30, 2006
Posts: 316
I heard JAXB can convert xml to java objects. Given a XML file and its schema, do I HAVE TO create java classes that map to the schema first ? If yes, is there any standard jdk tool that can help me create such java class templates using the given xml schema ??
Shaan Shar
Ranch Hand

Joined: Dec 27, 2005
Posts: 1249

Any insight on this topic!!! As I am also looking for same kind of stuff


The Best way to predict your future is to create it - Every great individual common man
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874


Where did you get this old thread to start with
If you just need to parse the XML and get the node values , then opt for JAXP parsers , otherwise a need to store the runtime objects then JAXB is best option

xjc JAXB compiler can be used to to convert xsd to java JAXB objects. See this and this one
Ramamoorthy Govindaraj
Greenhorn

Joined: Dec 31, 2009
Posts: 5
How do I convert my xml line by line instead of indentation? since, one of our application expects jaxb generated output be line by line xml. if it is generated with indentation, it failed.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Ramamoorthy, perhaps you should consider starting a new thread for that question. It doesn't appear to have anything to do with the original question which this thread was based on.

And when you do that it would help if you explained the details. Such as, you didn't say what "failed" meant. And it would help if you defined non-standard terminology like "line by line" too. Possibly examples would help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: convert xml to java objects using JAXB