om.DomNode.selectByPath
Finds descendant DOM nodes from an XPath-like pattern.
Syntax
selectByPath(
path STRING )
RETURNS om.NodeList
- path is an XPath-like pattern.
Usage
The selectByPath()
method scans the DOM tree for descendant nodes
from the specified XPath-like pattern.
The selectByPath()
method supports a limited XPath
syntax.
The search pattern must always start with /
or //
, must contain
at least on tag name, and the attributes expression allows only equality comparison.
The pattern supported by selectByPath()
is limited to the following syntax:
{
/ |
// }
TagName [
[@AttributeName="Value"] ]
[...]
DOM node tag names and attributes names are case-sensitive.
The method creates a list of nodes as an om.NodeList
object. This list object is
then used to process the nodes found.
XPath expression | Description |
---|---|
|
The element |
|
All |
|
All |
|
All |
|
All |
|
All elements that are children of |
|
All |
|
All |
Example
DEFINE node om.DomNode,
nodelist om.NodeList
...
LET nodelist = node.selectByPath("//Grid/Table[@tabName=\"t1\"]")
For a complete example, see Example 2: Search nodes by XPath.