Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

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: 43028
76
  • 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.

 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic