Package net.sf.saxon.sxpath

This package provides an alternative API for executing XPath expressions directly from a Java application: unlike the API in package net.sf.saxon.xpath, these interfaces are not dependent on JAXP 1.3.

See:
          Description

Interface Summary
XPathStaticContext This interface defines methods that must be provided when Saxon's free-standing XPath API is used.
 

Class Summary
AbstractStaticContext An abstract and configurable implementation of the StaticContext interface, which defines the static context of an XPath expression.
IndependentContext An IndependentContext provides a context for parsing an XPath expression appearing in a context other than a stylesheet.
XPathDynamicContext This object represents the dynamic XPath execution context for use in the free-standing Saxon XPath API.
XPathEvaluator This class provide a native Saxon API for free-standing evaluation of XPath expressions.
XPathExpression This class is a representation of an XPath Expression for use with the XPathEvaluator class.
XPathVariable An object representing an XPath variable for use in the standalone XPath API.
 

Package net.sf.saxon.sxpath Description

This package provides an alternative API for executing XPath expressions directly from a Java application: unlike the API in package net.sf.saxon.xpath, these interfaces are not dependent on JAXP 1.3. The API can be used either in a free-standing Java application (that is, where there is no XSLT stylesheet), or it can be used from within Java extension functions called from XPath expressions within a stylesheet.

If you have JDK 1.5 installed, you should probably be using the standard XPath API defined in JAXP 1.3, which is available in package net.sf.saxon.xpath, distributed in a separate JAR file saxon8-xpath.jar. This interface is provided for use it situations where installing JAXP 1.3 is inconvenient. It provides less functionality than the JAXP API, for example it does not allow XPath expressions to reference variables or functions, and it gives no control over the result type of the expression (you can control this by including casts or conversion functions within the expression itself).

The method XPathEvaluator.build(Source) is probably the most convenient way of building a Saxon tree, and can be used quite independently of the XPath API.

Michael H. Kay
Saxonica Limited
9 February 2005



Copyright (C) Michael H. Kay. All rights reserved.