net.sf.saxon.xpath

Class XPathFactoryImpl

public class XPathFactoryImpl extends XPathFactory

Saxon implementation of the JAXP 1.3 XPathFactory
Constructor Summary
XPathFactoryImpl()
Method Summary
ConfigurationgetConfiguration()
Get the Configuration object
booleangetFeature(String feature)
Get a feature of this XPath implementation.
booleanisObjectModelSupported(String model)
Test whether a given object model is supported.
protected ConfigurationmakeConfiguration()
XPathnewXPath()
Create an XPath evaluator
voidsetFeature(String feature, boolean b)
Set a feature of this XPath implementation.
voidsetXPathFunctionResolver(XPathFunctionResolver xPathFunctionResolver)
Set a resolver for XPath functions.
voidsetXPathVariableResolver(XPathVariableResolver xPathVariableResolver)
Set a resolver for XPath variables.

Constructor Detail

XPathFactoryImpl

public XPathFactoryImpl()

Method Detail

getConfiguration

public Configuration getConfiguration()
Get the Configuration object

getFeature

public boolean getFeature(String feature)
Get a feature of this XPath implementation. The only features currently recognized are:

Parameters: feature a URI identifying the feature

Returns: true if the feature is on, false if it is off

Throws: XPathFactoryConfigurationException if the feature name is not recognized

isObjectModelSupported

public boolean isObjectModelSupported(String model)
Test whether a given object model is supported. Returns true if the object model is the Saxon object model, DOM, JDOM, or XOM

Parameters: model The URI identifying the object model.

Returns: true if the object model is one of OBJECT_MODEL_SAXON, XPathConstants#DOM_OBJECT_MODEL, OBJECT_MODEL_JDOM, or OBJECT_MODEL_XOM

makeConfiguration

protected Configuration makeConfiguration()

newXPath

public XPath newXPath()
Create an XPath evaluator

Returns: an XPath object, which can be used to compile and execute XPath expressions.

setFeature

public void setFeature(String feature, boolean b)
Set a feature of this XPath implementation. The only features currently recognized are:

Parameters: feature a URI identifying the feature b true to set the feature on, false to set it off

Throws: XPathFactoryConfigurationException if the feature name is not recognized

setXPathFunctionResolver

public void setXPathFunctionResolver(XPathFunctionResolver xPathFunctionResolver)
Set a resolver for XPath functions. This will be used to obtain an implementation of any external function referenced in an XPath expression. This is not required for system functions, Saxon extension functions, constructor functions named after types, or extension functions bound using a namespace that maps to a Java class.

Parameters: xPathFunctionResolver The object used to resolve references to external functions.

setXPathVariableResolver

public void setXPathVariableResolver(XPathVariableResolver xPathVariableResolver)
Set a resolver for XPath variables. This will be used to obtain the value of any variable referenced in an XPath expression. The variable resolver must be allocated before the expression is compiled, but it will only be called when the expression is evaluated.

Parameters: xPathVariableResolver The object used to resolve references to variables.