Summary:
See also: Built-in Classes, XML Utils
The NodeList class holds a list of DomNode objects created from a selection method.
om.NodeList
Object Methods | |
Name | Description |
item( index INTEGER ) RETURNING om.DomNode |
Returns the DomNode object at the given position (first is 1). Returns NULL if the item does not exist. |
getLength( ) RETURNING INTEGER |
Returns the number of items in the list. |
Search for child nodes by tag name:
01
MAIN02
DEFINE nl om.NodeList03
DEFINE r, n om.DomNode04
DEFINE i INTEGER05
06
LET r = ui.Interface.getRootNode()07
LET nl = r.selectByTagName("Form")08
09
FOR i=1 to nl.getLength()10
LET n = nl.item(i)11
DISPLAY n.getAttribute("name")12
END FOR13
14
END MAIN
Search for child nodes by XPath:
01
MAIN02
DEFINE nl om.NodeList03
DEFINE r, n om.DomNode04
DEFINE i INTEGER05
06
LET r = ui.Interface.getRootNode()07
LET nl = r.selectByPath("//Window[@name=\"screen\"]")08
09
FOR i=1 to nl.getLength()10
LET n = nl.item(i)11
DISPLAY n.getAttribute("name")12
END FOR13
14
END MAIN