This appendix contains the complete Java [Java] bindings for the Level 3 Document Object Model XPath.
The Java files are also available as http://www.w3.org/TR/2001/WD-DOM-Level-3-XPath-20010618/java-binding.zip
package org.w3c.dom.xpath; public class XPathException extends RuntimeException { public XPathException(short code, String message) { super(message); this.code = code; } public short code; };
package org.w3c.dom.xpath; import org.w3c.dom.Node; public interface XPathEvaluator { public boolean evaluateAsBoolean(String expression, Node contextNode, NamespaceResolver resolver) throws XPathException; public double evaluateAsNumber(String expression, Node contextNode, NamespaceResolver resolver) throws XPathException; public String evaluateAsString(String expression, Node contextNode, NamespaceResolver resolver) throws XPathException; public Node evaluateAsNode(String expression, Node contextNode, NamespaceResolver resolver) throws XPathException; public ActiveNodeSet evaluateAsNodeSet(String expression, Node contextNode, NamespaceResolver resolver) throws XPathException; }
package org.w3c.dom.xpath; import org.w3c.dom.Node; public interface StaticNodeSet { public Node item(int index); public int getLength(); }
package org.w3c.dom.xpath; import org.w3c.dom.Node; import org.w3c.dom.DOMException; public interface ActiveNodeSet { public Node nextNode() throws DOMException; public void reset() throws DOMException; public ActiveNodeSet cloneSet() throws DOMException; public ActiveNodeSet getDocumentOrderedSet() throws DOMException; public StaticNodeSet getStaticNodeSet() throws DOMException; }
package org.w3c.dom.xpath; public interface NamespaceResolver { public String lookupNamespaceURI(String prefix); }