|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jaxen.BaseXPath
com.gargoylesoftware.htmlunit.html.xpath.HtmlUnitXPath
public class HtmlUnitXPath
Jaxen XPath adapter implementation for the HtmlUnit DOM model
This is the main entry point for matching an XPath against a HU-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 HtmlUnitXPath("a/b/c"); List results = path.selectNodes(domNode);
BaseXPath
,
Serialized FormConstructor Summary | |
---|---|
HtmlUnitXPath(String xpathExpr)
Construct given an XPath expression string. |
|
HtmlUnitXPath(String xpathExpr,
Navigator navigator)
Construct given an XPath expression string and a Document Navigator. |
Method Summary | |
---|---|
static Navigator |
buildSubtreeNavigator(DomNode node)
Builds a navigator that will see the provided node as the "document" and only navigate in its children. The returned navigator can only be used to evaluate xpath expressions on nodes of the same document as the provided one. |
String |
toString()
Gives the xpath expression provided to c'tor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HtmlUnitXPath(String xpathExpr) throws JaxenException
xpathExpr
- The XPath expression.
JaxenException
- if there is a syntax error while parsing the expression.public HtmlUnitXPath(String xpathExpr, Navigator navigator) throws JaxenException
xpathExpr
- The XPath expression.navigator
- the document navigator to use for evaluation
JaxenException
- if there is a syntax error while parsing the expression.Method Detail |
---|
public static Navigator buildSubtreeNavigator(DomNode node)
node
- the node that should be considered as the root by the navigator
public String toString()
toString
in class BaseXPath
BaseXPath.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |