Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

Sponsored Links

Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs

XML glossary

XML acronyms for Java developers

  • Print
  • Feedback

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.

Back to index

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.

Back to index

JAXB

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.

Back to index

XML building blocks

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

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.

  • Print
  • Feedback
What is Tech Briefcase?
TechBriefcase is a new, free service where IT Professionals can Search, Store and Share IT white papers and content like this. Learn more
Bookmark content
Speed up your research efforts with content across the web.
Search and Store
Find the white papers you need. Create folders for any topic.
View Anywhere
Open your briefcase on your iPhone, tablet or desktop. Share with colleagues.
Don't have an account yet?

Resources