Home » xml-commons-external-1.4.01-src » org.w3c » dom » xpath » [javadoc | source]
org.w3c.dom.xpath
public interface: XPathEvaluator [javadoc | source] 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.
Method from org.w3c.dom.xpath.XPathEvaluator Summary:
createExpression,   createNSResolver,   evaluate
Method from org.w3c.dom.xpath.XPathEvaluator Detail:
 public XPathExpression createExpression(String expression,
    XPathNSResolver resolver) throws XPathException, DOMException
    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 XPathNSResolver createNSResolver(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 Object evaluate(String expression,
    Node contextNode,
    XPathNSResolver resolver,
    short type,
    Object result) throws XPathException, DOMException
    Evaluates an XPath expression string and returns a result of the specified type if possible.