• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

convert xml to java objects using JAXB

 
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ??
 
Ranch Hand
Posts: 1252
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any insight on this topic!!! As I am also looking for same kind of stuff
 
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 27529
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic