• 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

Doubt regarding JAXB

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doesnt JAXB score over DOM2 everytime? In the sense , if I have a document , I can marshall it into its object oriented version of interfaces and content trees.
So even if various parts of my app need to work on the doc , I have the XML represented n these classes.

So when would I ever want to use DOM over JAXB??

Do let me know if my concepts are shaky.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
The answer to your first statement is: No.
JAXB and DOM are used for different things.
With JAXB, one binds XML data that adhers to one or more XML schemas that are known beforehand. The result is an object tree of special classes created by the JAXB schema compiler.
DOM is more suitable to process arbitrary XML data, perhaps adhering to some schema that you do not know of beforehand. DOM also creates an object tree in memory, but the objects are of general classes, such as Node, Element, Text etc (all in the org.w3c.dom package).
Best wishes!
 
Sachet Varma
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Ivan. Its clear now.
 
Nothing? Or something? Like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic