Package org.jaxen.dom

Class DOMXPath

  • All Implemented Interfaces:
    java.io.Serializable, XPath

    public class DOMXPath
    extends BaseXPath
    An XPath implementation for the W3C DOM.

    This is the main entry point for matching an XPath against a DOM tree. You create a compiled XPath object, then match it against one or more context nodes using the BaseXPath.selectNodes(Object) method, as in the following example:

     XPath path = new DOMXPath("a/b/c");
     List results = path.selectNodes(domNode);
    Version:
    $Revision$
    See Also:
    BaseXPath, Serialized Form
    • Constructor Detail

      • DOMXPath

        public DOMXPath​(java.lang.String xpathExpr)
                 throws JaxenException
        Create a new DOMXPath from an XPath expression string.
        Parameters:
        xpathExpr - the XPath expression
        Throws:
        JaxenException - if there is a syntax error in the expression