net.sf.saxon.sxpath
public class XPathEvaluator extends Object
Constructor Summary | |
---|---|
XPathEvaluator()
Default constructor. | |
XPathEvaluator(Configuration config)
Construct an XPathEvaluator with a specified configuration. |
Method Summary | |
---|---|
NodeInfo | build(Source source)
Build a source document. |
XPathExpression | createExpression(String expression)
Prepare an XPath expression for subsequent evaluation. |
Configuration | getConfiguration()
Get the Configuration in use |
NamespaceResolver | getNamespaceResolver()
Get the external namespace resolver, if one has been set using |
IndependentContext | getStaticContext()
Get the current static context. |
static void | main(String[] args)
A simple command-line interface for the XPathEvaluator (not documented).
|
void | setNamespaceResolver(NamespaceResolver namespaceContext)
Set the external namespace resolver to be used. |
void | setStaticContext(IndependentContext context)
Set the static context for compiling XPath expressions. |
void | setStripSpace(boolean strip)
Indicate whether all whitespace text nodes in the source document are to be
removed. |
Parameters: config the configuration to be used
Parameters: source a JAXP Source object. This may be any implementation of Source that Saxon recognizes: not only the standard kinds of source such as StreamSource, SAXSource, and DOMSource, but also for example a JDOM or XOM DocumentWrapper.
Returns: the NodeInfo representing the root of the constructed tree.
Throws: XPathException if, for example, XML parsing fails.
Parameters: expression The XPath expression to be evaluated, supplied as a string.
Returns: an XPathExpression object representing the prepared expression
Throws: XPathException if the syntax of the expression is wrong, or if it references namespaces, variables, or functions that have not been declared.
Returns: the namespace context if set, or null otherwise
Parameters: namespaceContext The namespace context
Parameters: strip True if all whitespace text nodes are to be stripped from the source document, false otherwise. The default if the method is not called is false.