# The XPath API

This section describes how to use Saxon as a Java class library, without making any use of XSLT stylesheets. It includes information on the XPath API, and the API for the Saxon implementation of the XPath object model. On other pages you will find the API for XSLT transformation, the API for running XQuery, and the API for Schema validation.

The first section below describes the XPath API. This allows a Java application to execute XPath expressions against a source document, and manipulate the results. No stylesheet is involved.

From Saxon 8.2, this API implements and extends the XPath API defined in JAXP 1.3, so it should be possible to write applications that are portable between Saxon and other products implementing this interface. Some of the extensions to this interface are provided because Saxon supports XPath 2.0, whereas JAXP 1.3 is designed primarily for XPath 1.0; some are provided for backwards compatibility; and some are provided to allow applications a finer level of control if required.

JAXP 1.3 is available as a standard part of JDK 1.5 (also referred to as Java 5). It can be installed as an add-on to JDK 1.4, but unfortunately Sun's license for this add-on does not allow redistribution. It must therefore be installed separately. To work around the problems this causes, especially for users who want to embed Saxon in products that are then distributed further, Saxon also provides a standalone XPath API that is not dependent on JAXP 1.3.

The classes that deliver the JAXP XPath API suport are in the separate JAR file `saxon8-xpath.jar`.

In addition to the APIs described here, Saxon's JavaDoc documentation describes all the public classes and methods that are available for advanced users. These are all subject to change from one release to the next.

Expand | Next