|
|||||
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(java.lang.String xpathExpr)
Construct given an XPath expression string. |
|
HtmlUnitXPath(java.lang.String xpathExpr,
org.jaxen.Navigator navigator)
Construct given an XPath expression string and a Document Navigator. |
Method Summary | |
---|---|
static org.jaxen.Navigator |
buildSubtreeNavigator(DomNode node)
Builds a navigator that will see the provided node as the "document" and only navigate in its children. |
java.lang.String |
toString()
Gives the xpath expression provided to c'tor. |
Methods inherited from class org.jaxen.BaseXPath |
---|
addNamespace, booleanValueOf, debug, evaluate, getFunctionContext, getNamespaceContext, getNavigator, getRootExpr, getVariableContext, numberValueOf, selectNodes, selectSingleNode, setFunctionContext, setNamespaceContext, setVariableContext, stringValueOf, valueOf |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HtmlUnitXPath(java.lang.String xpathExpr) throws org.jaxen.JaxenException
xpathExpr
- The XPath expression.
org.jaxen.JaxenException
- if there is a syntax error while
parsing the expression.public HtmlUnitXPath(java.lang.String xpathExpr, org.jaxen.Navigator navigator) throws org.jaxen.JaxenException
xpathExpr
- The XPath expression.navigator
- the document navigator to use for evaluation
org.jaxen.JaxenException
- if there is a syntax error while
parsing the expression.Method Detail |
---|
public static org.jaxen.Navigator buildSubtreeNavigator(DomNode node)
node
- the node that should be considered as the root by the navigator
public java.lang.String toString()
toString
in class org.jaxen.BaseXPath
BaseXPath.toString()
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |