XPathEvaluatorpublic interface XPathEvaluator The evaluation of XPath expressions is provided by
XPathEvaluator . In a DOM implementation which supports the
XPath 3.0 feature, as described above, the XPathEvaluator
interface will be implemented on the same object which implements the
Document interface permitting it to be obtained by the usual
binding-specific method such as casting or by using the DOM Level 3
getInterface method. In this case the implementation obtained from the
Document supports the XPath DOM module and is compatible with the XPath
1.0 specification.
Evaluation of expressions with specialized extension functions or
variables may not work in all implementations and is, therefore, not
portable. XPathEvaluator implementations may be available
from other sources that could provide specific support for specialized
extension functions or variables as would be defined by other
specifications.
See also the Document Object Model (DOM) Level 3 XPath Specification. |
Methods Summary |
---|
public org.w3c.dom.xpath.XPathExpression | createExpression(java.lang.String expression, org.w3c.dom.xpath.XPathNSResolver resolver)Creates a parsed XPath expression with resolved namespaces. This is
useful when an expression will be reused in an application since it
makes it possible to compile the expression string into a more
efficient internal form and preresolve all namespace prefixes which
occur within the expression.
| public org.w3c.dom.xpath.XPathNSResolver | createNSResolver(org.w3c.dom.Node nodeResolver)Adapts any DOM node to resolve namespaces so that an XPath expression
can be easily evaluated relative to the context of the node where it
appeared within the document. This adapter works like the DOM Level 3
method lookupNamespaceURI on nodes in resolving the
namespaceURI from a given prefix using the current information
available in the node's hierarchy at the time lookupNamespaceURI is
called. also correctly resolving the implicit xml prefix.
| public java.lang.Object | evaluate(java.lang.String expression, org.w3c.dom.Node contextNode, org.w3c.dom.xpath.XPathNSResolver resolver, short type, java.lang.Object result)Evaluates an XPath expression string and returns a result of the
specified type if possible.
|
|