[jdom-interest] XPath support for JDOM

bob mcwhirter bob at werken.com
Mon Jul 30 13:32:20 PDT 2001

Y'all might've heard the rumours, but there is now underway an effort
for a new and better XPath engine to use with JDOM.

If you're interested, a beta version of Jaxen, the Java XPathEngine
is available.

Lots of XPaths work.  Lots don't.  (though, it can't be much worse than
the original werken.xpath).


Jaxen itself is built upon a new, hand-rolled parser, which interfaces
through the SAXPath API.  The required saxpath.jar is already included
in the Jaxen distribution, but if you want the take a look at the
primary source:


The Jaxen distribution contains samples of how to use it with JDOM
and dom4j.

Pretty easy, though:

            Document doc = buildMyDocument();
            XPath xpath = new XPath( xpathStr )

            List results = xpath.selectNodes( doc );

Jaxen is still definitely undergoing major development, but I think
finally, as of today, the public API has solidified for the most part.

A much better test-harness (thanks to James Strachan for donating his dom4j
xpath test-harness stuff) exists now.

If you're interested in tracking Jaxen, please, use the CVS access from
sourceforge, as we're fixing bugs and adding features on an hourly basis.

Right now, JDOM and dom4j are both supported within the single distribution.
We will soon add support for W3C-DOM, ElectricXML, and even an introspection-based
JavaBeans navigational model.

Thanks for the time and interest,

	-bob mcwhirter

More information about the jdom-interest mailing list