goog.ds.Expr
Classgoog.ds.Expr(opt_expr)
Create a new expression. An expression uses a string expression language, and from this string and a passed in DataNode can evaluate to a value, DataNode, or a DataNodeList.
opt_expr
{string
=}
.ALL_ATTRIBUTES
For DOM interop - all DOM attribute nodes Attribute nodes have dataName starting with "@"
.ALL_CHILD_NODES
For DOM interop - all DOM child nodes (text + element). Text nodes have dataName #text
.ALL_ELEMENTS
For DOM interop - all DOM element child nodes
.COUNT
Get the count of nodes matching an expression
.CURRENT
The current node
.NAME
Get the dataName of a node
.POSITION
Get the position of the "current" node in the current node list This will only apply for datasources that support the concept of a current node (none exist yet). This is similar to XPath position() and concept of current node
.create(expr)
Create an expression from a string, can use cached values
expr
{string
}
goog.ds.Expr
}
.getLast()
Gets the last part of the expression.
string
}
.getNext()
Gets the parent expression of this expression, or null if this is top level
goog.ds.Expr
}
.getNode(opt_ds, opt_canCreate)
Evaluate an expression on a data node, and return the first matching node Recursively walks through child nodes to evaluate
opt_ds
{goog.ds.DataNode
=}
opt_canCreate
{boolean
=}
goog.ds.DataNode
}
.getNodes(opt_ds, opt_canCreate)
Evaluate an expression on a data node, and return matching nodes Recursively walks through child nodes to evaluate
opt_ds
{goog.ds.DataNode
=}
opt_canCreate
{boolean
=}
goog.ds.DataNodeList
}
.getParent()
Gets the parent expression of this expression, or null if this is top level
goog.ds.Expr
}
.getSource()
Get the source data path for the expression
string
}
.getValue(opt_ds)
Evaluate an expression on a data node, and return a value Recursively walks through child nodes to evaluate TODO(user) Support other expression functions
opt_ds
{goog.ds.DataNode
=}