• 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

Is JDom the past?

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am studying XML and Java and I see that both SAX&DOM are now part of standard Java (JAXP). But JDOM is not. At a glance, I notice that the functionalities of Sax, DOM & JDOM are quite the same. So what are the differences between JDOM and JAXP? Should I ignore JDOM?

Thanks
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JDOM (just like other APIs like XOM and dom4j) sits on top of SAX and/or DOM. So there's nothing it can do that you can't do with just SAX/DOM. If you're happy using the DOM API, by all means, ignore those other libraries. But the reason they came about is because people didn't think too highly of DOM and were looking for a better API. The other libraries also have the advantage of being Java-centric, whereas DOM is a cross-language API; so it doesn't feel very Java-ish to use. I'm a fan of XOM, but I'd advise to check out all of them with a few sample programs, and then to use the one you most like.
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JODM supports both SAX and DOM methodology of XML parsing, So I suggest learn basics of this two methods and if you want to use the simplest implementation of this, go for JDOM library
 
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
If you use JDOM you will not find it easy to use cool stuff such as XPath that is in the standard Java Library.

Bill
 
Pham Huy Anh
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you, guys.

I get it now. SAX&DOM are standard and JDOM is something like framework. In the future, I would choose the one which fits the problem best.

 
But how did the elephant get like that? What did you do? I think all we can do now is read 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