XPath API implementation built on the top of Jaxen.

Package Specification

This package delivers implementation of XPath API built on the top of Jaxen.
This package is kind of wrapper/gateway that encapsulates Jaxen calls into API we need. Diagram bellow shows relations between Jaxen, XPath API and this package.

XPath API built on the top of Jaxen
 

Jaxen

Jaxen is an efficient, powerful, free and open-source implementation of XPath 1.0.
Features:

  1. Fully compatible with XPath 1.0,
  2. Precompiled xpath expressions - xpath can be compiled once and used many times with different documents and variable mappings,
  3. Variable resolving - variables are resolved at execution time, not at compilation time. Jaxen requires dedicated variable resolver that can be easily built on the top of any map.

Source data format

In general, Jaxen can work with many different XML document sources (W3C DOM, JDOM, etc.). This wrapper is configured to work only with W3C DOM source (see section Assumptions bellow).

Examples

To start using this implementation simply instantiate engine using constructor {@link org.xdv.xpath.jaxen.JaxenXPathEngine#JaxenXPathEngine}. After that you can proceed in a way described in example section in package {@link org.xdv.xpath}.

Assumptions, limitations

  1. It requires Jaxen 1.x package to work. Binary version (*.jar) can be downloaded from Jaxen project home page.
  2. Implementation works only with W3C DOM source. It means that:
  3. This implementation relaxes requirements from XPath API ({@link org.xdv.xpath}) which says that expression and execution-unit work together only if they were created by exactly the same engine instance.
    Using this implementation you can create expression and execution-unit using different instances of {@link org.xdv.xpath.jaxen.JaxenXPathEngine} and they will still work together.

Related Documentation

For overviews, examples please see: