Java News from Tuesday, February 22, 2005

I'm pleased to announce the first alpha release of XOM 1.1, my free-as-in-speech (LGPL) dual streaming/tree-based API for processing XML with Java. Version 1.1 maintains backwards compatibility with XOM 1.0 while adding a number of important new features including:

The XPath support is especially useful. You can now write declarative queries like these that find alls the person elements in place of complicated, fragile navigation code:

Nodes people = doc.query("//person");
XPathContext = new XPathContext("html", "");
Nodes toc = doc.query("//html:div[@id='toc']/child::node()", context)

The XPath support is based on the latest Jaxen source code. This is the same engine used in JDOM and dom4j. However, before bundling this with XOM I fixed a lot of bugs in Jaxen, and worked around several others. XOM is much more conformant to the XPath specification than either JDOM or dom4j. There's still at least one nasty bug in XPath evaluation I haven't been able to fix yet, but so far I've only seen it with an unusual, redundant union expression that's unlikely to arise in practice (//. | /). More importantly, there are probably other undiscovered bugs waiting to bite. If you spot any of the critters, holler and I'll try to stomp them.