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

Class Summary
XPathEvaluator This is a cut-down version of the XPathEvaluator in the net.sf.saxon.xpath package.
XPathExpression This class is a representation of an XPath Expression for use with the XPathEvaluator class.
 

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