iTP Active Transaction Pages (iTP ATP) Programmer's Guide

XML for ATP Add-On Module
iTP Active Transaction Pages (iTP ATP) Programmer’s Guide522292-002
5-50
Methods
Parameters
name – The name of an attribute to retrieve.
Return Value
ObjectReturns the XMLDOMAttribute with the supplied name, or null if the
named attribute cannot be found on this element.
Example
var doc = new XML.DOMDocument;
doc.load("sample.xml");
var root = doc.documentElement;
var node = root.childNodes.item(1).childNodes.item(9);
println(node.getAttributeNode("permanent").name);
Output
permanent
getElementsByTagName
Returns a XMLDOMNodeList of all descendant elements with a given tag name, in
the order in which they would be encountered in a preorder traversal of the
XMLDOMElement tree.
Syntax
var obj XMLDOMNodeList = oXMLDOMElement.getElementsByTagName
(name)
Parameters
name – The name of the tag to match on. The special value “*” matches all tags.
Return Value
Object – The XMLDOMNodeList object containing all elements that matched the
supplied name.
Note that the XMLDOMNodeList object is returned even if there are no matches. In
such a case, the length of the list is set to zero. The XMLDOMNodeList object is
live and immediately reflects changes to the nodes that appear in the list.
Example
var doc = new XML.DOMDocument;
doc.load("sample.xml");
var root = doc.documentElement;
var list = root.getElementsByTagName("GPA");
println(list.length);
Output
5