1 38 package com.gargoylesoftware.htmlunit.html.xpath; 39 40 import org.jaxen.BaseXPath; 41 import org.jaxen.JaxenException; 42 import org.jaxen.Navigator; 43 44 import com.gargoylesoftware.htmlunit.html.DomNode; 45 46 66 public class HtmlUnitXPath extends BaseXPath { 67 68 private static final long serialVersionUID = -3902959929710269843L; 69 private final String xpath_; 70 71 77 public HtmlUnitXPath(final String xpathExpr) throws JaxenException { 78 this( xpathExpr, DocumentNavigator.instance ); 79 } 80 81 88 public HtmlUnitXPath(final String xpathExpr, final Navigator navigator) throws JaxenException { 89 super(xpathExpr, navigator); 90 xpath_ = xpathExpr; 91 } 92 93 94 102 public static Navigator buildSubtreeNavigator(final DomNode node) { 103 return new NodeRelativeNavigator(node); 104 } 105 106 111 public String toString() { 112 return xpath_; 113 } 114 } 115 | Popular Tags |