SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Conditions of Use
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
The XPath API
| Introduction
» | The JAXP XPath API
| The Standalone XPath API
| The NodeInfo Object
| Building the Source Document
Saxon on .NET
Extensibility
Saxon Extensions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
Standards Conformance

# The JAXP XPath API

Saxon provides an API for executing XPath expressions. The API is an implementation of the JAXP 1.3 XPath API, which in turn is loosely modeled on the DOM Level 3 API for XPath (which Saxon does not implement). For full documentation, see the Javadoc description of package `net.sf.saxon.xpath`. Two sample applications using this API are available: they are called `XPathExample.java` and `ApplyXPathJAXP.java`, and can be found in the `samples/java` directory.

The `XPathExample.java` application is written to use JAXP 1.3 interfaces. To run this application, see the instructions in Shakespeare XPath Sample Application.

The `ApplyXPathJAXP.java` application is an enhanced version of the class of the same name issued as a sample application in the JAXP 1.3 distribution. It has been enhanced to show the use of more advanced features, such as the ability to bind namespaces, variables, and functions, and also to demonstrate use of the XPath API with different object models.

Because the XPath API in Saxon predates the introduction of the JAXP 1.3 XPath API, there is often more than one way of achieving the same effect. It is likely that in time, some of the native Saxon methods will be deprecated and replaced by the standard JAXP methods.

The following sections describe use of the XPath API in more detail.

- Selecting the XPath implementation: Describes how to ensure that Saxon is selected as the XPath API implemenation

- Return types: Describes the mapping of XPath return types to Java classes

- Additional Saxon methods: Describes features of the Saxon implementation additional to the JAXP specification

Next