JDOM, The Java DOM (1/4) - exploring XML
JDOM, The Java DOM
Using XML with Java is amazingly simple: All you need is a JDK, some free class libraries, a text editor and some data to process. The Document Object Model (DOM) is a popular, standardized way of manipulating XML data. Java developers might prefer JDOM in the future, a more Java-oriented API for reading and writing XML Documents.
JDOM was created by Brett McLaughlin and Jason Hunter as an open source project, available from the JDOM site.
What's wrong with the W3C DOM?
The DOM was designed to be independent of any programming language; therefore it can be quite incovenient to use in a particular programming language, such as Java:- The DOM makes very limited use of the Java class library.
Many features have been reinvented, for instance creating a
NodeIterator
instead of usingjava.util.Iterator
. - Some areas have a weak design. Method overloading is not used because not all programming languages support it, for instance JavaScript.
- Named constants are often short integer instead of constant objects.
- There is only one kind of exception, details are provided by constants instead of having an exception class hierarchy.
- No Java-specific utility methods like equals(), hashCode(), clone(), or toString() are defined.
- Unexpected behavior can result in that
the value of a non-empty element is defined to be null, raising the
widely popular
java.lang.NullPointerException
. Some DOM implementations also allow the creation of malformed documents. - Parser independent interfaces are implemented by parser specific classes, and most programs must use these parser specific classes. Sun's API for XML Parsing JAXP helps solve this, but so far only for DOM Level 1.
The DOM and JDOM head-to-head...
Produced by Michael Claßen
All Rights Reserved. Legal Notices.
URL: https://www.webreference.com/xml/column25/index.html
Created: Dec 03, 2000
Revised: Dec 03, 2000