Recent articles:
Popular archives:
Java: A platform for platforms
Sun's reorg may seem promising to shareholders but it's also a scramble for position. The question now is whether Sun can,
or wants to, maintain its hold on Java technology. Especially with enterprise leaders like SpringSource and RedHat investing
heavily in Java's future as a platform for platforms
Also see:
Discuss: Java: A platform for platforms?
Page 2 of 5
JDOM's greatest strengths include its ease of use and specification compliance, but some developers criticize its performance. At the time of this writing, JDOM has not yet officially reached version 1.0; however, it is already stable and fairly bug-free, so don't let the version number put you off.
If you are considering JDOM, also consider DOM4J.
Because DOM4J fixes the same DOM problems as JDOM, they have similar APIs. In fact, DOM4J was originally a fork from JDOM.
They differ most in that DOM4J, like DOM, uses interfaces in some places where JDOM uses objects; consequently, in DOM4J,
you need a factory to create elements, attributes, and so on. While that makes DOM4J slightly harder to use, it does make
DOM4J more flexible, since there can be several org.dom4j.Element implementations.
Sun used DOM4J in the JAXM (Java APIs for XML Messaging) reference implementation, so Sun clearly sees DOM4J as a viable and sensible solution. As a DOM4J advantage compared to JDOM, DOM4J includes Jaxen, letting you use Xpath expressions to select nodes from the tree. While Jaxen also works with JDOM, the two are not well integrated.
JAXB (Java API for XML Binding) offers a fresh method to parse XML documents. So fresh that the ink has yet to dry, so to speak. JAXB, not due for release until the end of 2002, is an in-memory model like the DOM variants, but the similarity with DOM ends there. With JAXB, you compile your DTD (document type definition) (or soon XML Schema) into Java classes. You sometimes will write instructions to the compiler to help it create exactly the Java classes you want or you can let it create defaults.
From that point on, the only APIs you need are your newly created Java classes. The current JAXB early access release creates
Java classes with methods called marshal() and unmarshal(), which load and save to and from disk; from then on you use getters and setters just like in any other JavaBean.
JAXB represents a promising way to ease XML editing. It's a technology worth watching.
XML building block technologies represent the foundation upon which the rest of the XML world is built. An understanding of many of these key technologies proves vital to employing the technologies found in this glossary's other sections.
Namespaces let you mix tags from different sources without confusing their origin. Each element in a namespace acquires two extra bits of information.
First, and most importantly, is a unique identifier, generally resembling a URL, that distinguishes elements from different sources. While unique identifiers resemble URLs, you're
not guaranteed a response if you type an identifier into a Web browser. For example, XSL (Extensible Stylesheet Language)
uses "http://www.w3.org/1999/XSL/Transform" as its unique identifier, which every element using the specified namespace includes.
However, if you had to type that whole string each time you used an element, things would quickly become unreadable. In response,
namespaces' second extra bit of information is a shortcut. For XSL, developers generally use the string xsl, but any string would do.