DOM Level 3 XPath

The Saxon API only works with Saxon. The Xalan API only works with Xalan. Both only work with Java. The W3C DOM Working Group is attempting to define a standard, cross-engine XPath API that can be used with many different XPath engines (as of summer 2002, this effort is just beginning and is not yet supported by any implementations). DOM Level 3 includes an optional XPath module in the org.w3c.dom.xpath package. The feature string “XPath” with the version “3.0” tests for the presence of this module. For example,

if (!impl.hasFeature("XPath", "3.0")) {
  System.err.println
   ("This DOM implementation does not support XPath");
  return;
}

Caution

This section is based on the March 28, 2002, working draft of the Document Object Model ...

Get Processing XML with Java™: A Guide to SAX, DOM, JDOM, JAXP, and TrAX now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.