44
45 import org.w3c.dom.Node;
46 import org.w3c.dom.DOMException;
47
48 /**
49 * The evaluation of XPath expressions is provided by
50 * <code>XPathEvaluator</code>. In a DOM implementation which supports the
51 * XPath 3.0 feature, as described above, the <code>XPathEvaluator</code>
52 * interface will be implemented on the same object which implements the
53 * <code>Document</code> interface permitting it to be obtained by the usual
54 * binding-specific method such as casting or by using the DOM Level 3
55 * getInterface method. In this case the implementation obtained from the
56 * Document supports the XPath DOM module and is compatible with the XPath
57 * 1.0 specification.
58 * <p>Evaluation of expressions with specialized extension functions or
59 * variables may not work in all implementations and is, therefore, not
60 * portable. <code>XPathEvaluator</code> implementations may be available
61 * from other sources that could provide specific support for specialized
62 * extension functions or variables as would be defined by other
63 * specifications.
64 * <p>See also the <a href='http://www.w3.org/2002/08/WD-DOM-Level-3-XPath-20020820'>Document Object Model (DOM) Level 3 XPath Specification</a>.
65 */
66 public interface XPathEvaluator {
67 /**
68 * Creates a parsed XPath expression with resolved namespaces. This is
69 * useful when an expression will be reused in an application since it
70 * makes it possible to compile the expression string into a more
71 * efficient internal form and preresolve all namespace prefixes which
72 * occur within the expression.
73 * @param expression The XPath expression string to be parsed.
74 * @param resolver The <code>resolver</code> permits translation of
75 * prefixes within the XPath expression into appropriate namespace URIs
76 * . If this is specified as <code>null</code>, any namespace prefix
77 * within the expression will result in <code>DOMException</code>
78 * being thrown with the code <code>NAMESPACE_ERR</code>.
79 * @return The compiled form of the XPath expression.
80 * @exception XPathException
81 * INVALID_EXPRESSION_ERR: Raised if the expression is not legal
82 * according to the rules of the <code>XPathEvaluator</code>i
83 * @exception DOMException
84 * NAMESPACE_ERR: Raised if the expression contains namespace prefixes
|
44
45 import org.w3c.dom.Node;
46 import org.w3c.dom.DOMException;
47
48 /**
49 * The evaluation of XPath expressions is provided by
50 * <code>XPathEvaluator</code>. In a DOM implementation which supports the
51 * XPath 3.0 feature, as described above, the <code>XPathEvaluator</code>
52 * interface will be implemented on the same object which implements the
53 * <code>Document</code> interface permitting it to be obtained by the usual
54 * binding-specific method such as casting or by using the DOM Level 3
55 * getInterface method. In this case the implementation obtained from the
56 * Document supports the XPath DOM module and is compatible with the XPath
57 * 1.0 specification.
58 * <p>Evaluation of expressions with specialized extension functions or
59 * variables may not work in all implementations and is, therefore, not
60 * portable. <code>XPathEvaluator</code> implementations may be available
61 * from other sources that could provide specific support for specialized
62 * extension functions or variables as would be defined by other
63 * specifications.
64 * <p>See also the <a href='https://www.w3.org/TR/DOM-Level-3-XPath/'>Document Object Model (DOM) Level 3 XPath Specification</a>.
65 */
66 public interface XPathEvaluator {
67 /**
68 * Creates a parsed XPath expression with resolved namespaces. This is
69 * useful when an expression will be reused in an application since it
70 * makes it possible to compile the expression string into a more
71 * efficient internal form and preresolve all namespace prefixes which
72 * occur within the expression.
73 * @param expression The XPath expression string to be parsed.
74 * @param resolver The <code>resolver</code> permits translation of
75 * prefixes within the XPath expression into appropriate namespace URIs
76 * . If this is specified as <code>null</code>, any namespace prefix
77 * within the expression will result in <code>DOMException</code>
78 * being thrown with the code <code>NAMESPACE_ERR</code>.
79 * @return The compiled form of the XPath expression.
80 * @exception XPathException
81 * INVALID_EXPRESSION_ERR: Raised if the expression is not legal
82 * according to the rules of the <code>XPathEvaluator</code>i
83 * @exception DOMException
84 * NAMESPACE_ERR: Raised if the expression contains namespace prefixes
|