public class XPathFinder extends ChildVisitor
Modifier and Type | Field and Description |
---|---|
static String |
AT |
static String |
BRACKET0 |
static String |
BRACKET1 |
static String |
COLON |
static String |
SEP |
static String |
XPNS |
Constructor and Description |
---|
XPathFinder() |
Modifier and Type | Method and Description |
---|---|
Node |
findNode(Document root,
String xpath) |
List<Node> |
findNodes(Document root,
String xpathExpression) |
NamespaceContext |
getNamespaceContext() |
static String |
getXpath(Document root,
Node target) |
boolean |
isReadyForEvaluation() |
protected void |
visitNode(Node e) |
visit, visit, visit, visit
public static final String SEP
public static final String AT
public static final String COLON
public static final String BRACKET0
public static final String BRACKET1
public static final String XPNS
public static String getXpath(Document root, Node target)
root
- root nodetarget
- Element or Attribute node to generate the xpath for.public Node findNode(Document root, String xpath)
root
- context in which to find the node.xpath
- location path for the attribute or element.public List<Node> findNodes(Document root, String xpathExpression)
root
- context in which to find the node.xpathExpression
- location path for the attribute or element.protected void visitNode(Node e)
visitNode
in class ChildVisitor
public boolean isReadyForEvaluation()
public NamespaceContext getNamespaceContext()