net.sf.saxon.xpath
Class XPathFactoryImpl
XPathFactory
net.sf.saxon.xpath.XPathFactoryImpl
public class XPathFactoryImpl
extends XPathFactory
Saxon implementation of the JAXP 1.3 XPathFactory
XPathFactoryImpl
public XPathFactoryImpl()
Default constructor: this creates a Configuration as well as creating the XPathFactory. Any documents
accessed using this XPathFactory must be built using this same Configuration.
XPathFactoryImpl
public XPathFactoryImpl(Configuration config)
Constructor using a user-supplied Configuration.
This constructor is useful if the document to be queried already exists, as it allows the configuration
associated with the document to be used with this XPathFactory.
config
- the Saxon configuration
getConfiguration
public Configuration getConfiguration()
Get the Configuration object used by this XPathFactory
getFeature
public boolean getFeature(String feature)
throws XPathFactoryConfigurationException
Get a feature of this XPath implementation. The only features currently
recognized are:
feature
- a URI identifying the feature
- true if the feature is on, false if it is off
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, DOM4J, or XOM
model
- The URI identifying the object model.
newXPath
public XPath newXPath()
Create an XPath evaluator
- an XPath object, which can be used to compile and execute XPath expressions.
setFeature
public void setFeature(String feature,
boolean b)
throws XPathFactoryConfigurationException
Set a feature of this XPath implementation. The only features currently
recognized are:
-
XMLConstants.FEATURE_SECURE_PROCESSING
-
FeatureKeys.SCHEMA_VALIDATION
: requests schema validation of source documents.
The property is rejected if the configuration is not schema-aware.
feature
- a URI identifying the featureb
- true to set the feature on, false to set it off
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.
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.
xPathVariableResolver
- The object used to resolve references to variables.