• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAXP and JAXB

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When should we use JAXB or JAXP? I saw some overlap on them.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A quick search of the XML forum discovers that this has recently been discussed.
[ January 26, 2006: Message edited by: Ulf Dittmer ]
 
Silvio Esser
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the info.

If I need to create a XML document, I can use JAXP(DOM) or JAXB. But which way is the best?
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you aren't currently using or willing to start using XMLSchema to define an XSD for your documents, then you can ignore JAXB. Nothing wrong with JAXB, just that it is intended to fit into the XMLSchema tools space, not the DTD tools space.
 
Marshal
Posts: 28193
95
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

Originally posted by Silvio Esser:
If I need to create a XML document, I can use JAXP(DOM) or JAXB. But which way is the best?

That depends entirely on where the data for the XML document comes from, and what you plan to do with the XML document.

If you have a Java object and you want to convert it into XML, and subsequently convert back into the same object, then use JAXB. If you have data in a database (for example) and you want to make it into XML, then use one of the JAXP technologies. As usual in the computing business there is no such thing as "best". Spend some time learning about the various XML technologies and you will not find it necessary to ask questions like this one. Specific questions are much easier to answer.
 
Silvio Esser
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I may call it "better" instead of "best".

Thanks for the inputs. I agree with you that there are just too many
frameworks or tools out there that do a little helps, but more confusions.
I know BEA has xBean does the same thing as JAXB.
[ January 26, 2006: Message edited by: Silvio Esser ]
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might browse the last couple of weeks of posts in this forum. As I recall, a variety of XML creation problems have been discussed recently, with many different solutions proposed.
Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic