The xpath Library
Xpath: an XPath library for OCaml

This is a _non_-release (pre-alpha) of Xpath, an XPath library for OCaml.
Modules
Parsing Xpath expressions and location paths:

Namespaces in XML
Data model from the XPath recommendation
Evaluating Xpath expressions
Importing the document tree from PXP
Overview
Apart from the Xpath_from_pxp module, the library is independant
of the XML parser.

A test program is provided. It parse an XML file given as argument, then asks for an XPath expression from stdin, evaluates this expression, and print the result to stdout as an HTML fragment (for nodeset, the program tries to reproduce the source XML document with selected node hilighted).

The library is modularized and functorial, so that it is (hopefully) easy to support a new XPath data model implemention. The evalutor is parametrized by a Xpath_tree.TREE module (a module which handle the document tree : node, navigation, etc ...). A TREE can be constructed from a Xpath_tree.DATA, which handle only the nodes and their link (no navigation). As an example, a standalone lightweight DATA is provided and a module can build a tree for this model from a Pxp document.

A data model working directly on the Pxp document tree will probably be added (soon ?).

UTF-8 support

This pre-release use only UTF-8 internally and externally.
Acknowledgements

Gerd Stolpmann who produced a great XML parser and accepted many
feature requests necessary for Xpath.