|
||||||||||
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,
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. 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 org.jaxen.BaseXPath |
---|
addNamespace, booleanValueOf, createFunctionContext, createNamespaceContext, createVariableContext, debug, evaluate, getContext, getContextSupport, getFunctionContext, getNamespaceContext, getNavigator, getRootExpr, getVariableContext, numberValueOf, selectNodes, selectNodesForContext, selectSingleNode, selectSingleNodeForContext, setFunctionContext, setNamespaceContext, setVariableContext, stringValueOf, valueOf |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HtmlUnitXPath(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(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 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 |