Elliotte Rusty Harold has
announced a new tree-based XML API, XOM (from the generic term
XML object model), which he describes as
"closest in spirit to JDOM" and representing an
"effort to synthesize the best features of the
existing APIs while eliminating the worst".
Javadoc for his open source
(LGPL) Java implementation of the API is
available at the XOM web site, along with the
beginnings of a tutorial and a jar file and source distribution. It
requires a SAX2-compliant parser. Specifically,
it seems to require Xerces-J 2.1.0 or greater -- it
won't work with Xerces 2.0.x, Crimson, GNU JAXP
1.0b1, or Piccolo 1.0.2 because of deficiencies
in those parsers.
In a slide from a related What's Wrong with XML APIs (and how
to fix them) presentation, Harold lists some
high-level design principles that guided him in
development of XOM:
-
Principle of Least Surprise
-
As simple as it can be and no
simpler!
-
Use Java idioms where they fit
-
There's exactly one way to do it
-
Start small and grow as necessary
He says that he took a "Less is more" ("easy
to learn, easy to use, fast enough, and small
enough") approach to XOM, that, for example,
"deliberately eschews the many convenience
methods that make the JDOM API so cluttered". He
details some of the other differences between XOM
and JDOM in another slide from the presentation and
in the first section of his XOM FAQ
(which includes a list of XOM features that have
no equivalent in JDOM).
Harold has set up an open xom-interest mailing list for
both user and developer discussion about XOM.
Judging from the list archives, there's already
a lot of activity on the list.
Related stories
Elliotte Rusty Harold on the Future
of XML
|