By all means, look at it -- but realize that you're buying nonportability of your code in exchange for whatever advantages it might or might not offer.
In practice, the single implementation means JDOM code is more portable, not less. DOM code written in Java has limited portability, especially if your restrict yourself to the real DOM APIs. It has to be fixed up with JAXP to get any real work done, or alternately with parser specific classes. DOM Level 3 may fix some of this, but I expect to still find many inconsistencies between the different DOM implementations.
DOM is perhaps a little easier to layer on top of different storage models such as native XML databases than is JDOM. However, it's certainly not impossible to do this in JDOM. The advantages of interfaces are seriously overrated by many in the object oriented community. In my opinion, they're often actively harmful in a language such as Java that does not support design by contract, because they prevent types from enforcing their own invariants and method preconditions. The DOM specification requires implementations to check some (not all) XML well-formedness constraints, such as an element name cannot begin with a number. However, because DOM is defined in terms of interfaces rather than classes these rules are a paper tiger that cannot be enforced, and indeed many DOM implementations (though not Xerces) fail to enforce them.
The only real portability DOM offers beyond JDOM is the ability to change languages, that is to use the same DOM API for C++ or Java or Python. This is not especially useful to most (perhaps any) developers and is in large part responsible for the complexity and baroqueness of the DOM API. Different languages need different APIs. Interoperability is achieved through syntax (that is, XML) not through common APIs.
--
Elliotte Rusty Harold [EMAIL PROTECTED] Effective XML (Addison-Wesley, 2003) http://www.cafeconleche.org/books/effectivexml http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
