public class NodeVariable
extends java.lang.Object
node
variable for sub-queries and scripts that wraps
the node selected by an XPath query, exposing useful methods.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
Constructor and Description |
---|
NodeVariable(scriptella.driver.xpath.XPathExpressionCompiler compiler,
org.w3c.dom.Node node) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
get(java.lang.String expression)
Gets the text value(s) of the node(s) selected by the specified XPath expression.
|
java.lang.String |
getString(java.lang.String expression)
Gets the string value of the first selected node by the specified XPath expression.
|
java.lang.String |
getString(java.lang.String expression,
java.lang.String ifNull)
Gets the string value of the first selected node by the specified XPath expression.
|
java.lang.String[] |
getStringArray(java.lang.String expression)
Gets the text values of the nodes selected by the specified XPath expression.
|
void |
remove()
Removes this node from the document.
|
public static final java.lang.String NAME
public NodeVariable(scriptella.driver.xpath.XPathExpressionCompiler compiler, org.w3c.dom.Node node)
public java.lang.String[] getStringArray(java.lang.String expression)
expression
- xpath expression to evaluate.public java.lang.String getString(java.lang.String expression)
expression
- xpath expression to evaluate.public java.lang.String getString(java.lang.String expression, java.lang.String ifNull)
expression
- xpath expression to evaluate.ifNull
- String to return if the specified expression evaluates to null.public java.lang.Object get(java.lang.String expression)
expression
- xpath expression to evaluate.public void remove()
Copyright © Copyright 2006-2019 The Scriptella Project Team.