Package net.sf.saxon.xpath
Class XPathFactoryImpl
java.lang.Object
javax.xml.xpath.XPathFactory
net.sf.saxon.xpath.XPathFactoryImpl
Saxon implementation of the JAXP 1.3 XPathFactory
-
Field Summary
Fields inherited from class javax.xml.xpath.XPathFactory
DEFAULT_OBJECT_MODEL_URI, DEFAULT_PROPERTY_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the Configuration objectbooleangetFeature(String feature) Get a feature of this XPath implementation.booleanisObjectModelSupported(String model) Test whether a given object model is supported.protected ConfigurationnewXPath()Create an XPath evaluatorvoidsetFeature(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.Methods inherited from class javax.xml.xpath.XPathFactory
getProperty, newDefaultInstance, newInstance, newInstance, newInstance, setProperty
-
Constructor Details
-
XPathFactoryImpl
public XPathFactoryImpl()
-
-
Method Details
-
makeConfiguration
-
getConfiguration
Get the Configuration object -
isObjectModelSupported
Test whether a given object model is supported. Returns true if the object model is the Saxon object model, DOM, JDOM, or XOM- Specified by:
isObjectModelSupportedin classXPathFactory- Parameters:
model- The URI identifying the object model.- Returns:
- true if the object model is one of
NamespaceConstant.OBJECT_MODEL_SAXON,XPathConstants.DOM_OBJECT_MODEL,NamespaceConstant.OBJECT_MODEL_JDOM, orNamespaceConstant.OBJECT_MODEL_XOM, orNamespaceConstant.OBJECT_MODEL_DOM4J
-
setFeature
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.
- Specified by:
setFeaturein classXPathFactory- Parameters:
feature- a URI identifying the featureb- true to set the feature on, false to set it off- Throws:
XPathFactoryConfigurationException- if the feature name is not recognized
-
-
getFeature
Get 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.
- Specified by:
getFeaturein classXPathFactory- 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
-
-
setXPathVariableResolver
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.- Specified by:
setXPathVariableResolverin classXPathFactory- Parameters:
xPathVariableResolver- The object used to resolve references to variables.
-
setXPathFunctionResolver
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.- Specified by:
setXPathFunctionResolverin classXPathFactory- Parameters:
xPathFunctionResolver- The object used to resolve references to external functions.
-
newXPath
Create an XPath evaluator- Specified by:
newXPathin classXPathFactory- Returns:
- an XPath object, which can be used to compile and execute XPath expressions.
-