public class Path
extends java.lang.Object
The result of evaluating an expression is a set of Element nodes
that fulfill the location steps, with node tests, and predicates. The path
expression operates on an element tree.
Example:
Path expr = new Path("/hosts/host[name='kalle']/ip");
NodeSet s = path.eval(element_tree);
| Constructor and Description |
|---|
Path(java.lang.String pathStr)
Constructor for a Path from a path expression string.
|
| Modifier and Type | Method and Description |
|---|---|
NodeSet |
eval(Element contextNode)
Evaluates the Path given a contextNode.
|
java.lang.String |
toString()
Returns a string representation of this Path.
|
public Path(java.lang.String pathStr)
throws JNCException
JNCExceptionpublic NodeSet eval(Element contextNode) throws JNCException
Makes a selection by traversing the locationSteps, return an ArrayList (NodeSet) of Element nodes.
contextNode - The context node to evaluate expressions onJNCExceptionpublic java.lang.String toString()
toString in class java.lang.Object