The new directory java/xpath_rwapi/ has been added on the xslt20 branch.
It contains a set of packages which provides an abstract representation of
XPath 2.0 (and in the future XQuery 1.0) expressions. This representation
consists of a set of interfaces providing the following features:
Creation of new expressions, by using a DOM-like API or from a
string.
Traversal within an expression, by using both the visitor pattern or
getXXX methods (DOM-like).
Modification of existing expressions in a object-oriented way
(DOM-like)
Possibility to get the string representation of expression from the
AST
This API will evolve since the spec is not yet a recommendation, and also
not all xpath features are supported.
An full-implementation (all of preceding features) of this API is also
provided for a subset of XPath. You can have a rough idea of what is
implemented by taking a look at the org.apache.xpath.xpath_rwapi.Test
package. Basically, this implementation allows the construction of a
minimalist XPath AST independently of any kind of applications. The idea is
to perform a second pass (for example by using the visitor pattern) on the
AST to either compile or build an optimized interpreter (or other kind of
applications).
Enjoy
Lionel Villard