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-28
Methods
Return Value
objTextXMLDOMText Object
.
Example
var doc = new XML.DOMDocument;
doc.validateOnParse = true;
doc.load("sample.xml");
var node =
doc.documentElement.childNodes.item(0).childNodes.item(0);
var text = doc.createTextNode("New Text");
println(text.xml);
Output
New Text
getElementsByTagName
Returns an XMLDOM node list of all the elements with a given tag name. The
returned node list is “live,” in that changes to the document tree made after a
nodelist is initially returned are immediately reflected in the node list. The elements
in the node list are returned in the same order in which they would be encountered in
a preordered traversal of the document tree.
Syntax
oNodeList = doc.getElementsByTagName(tagName [, namespaceURI]);
Parameters
tagName – String specifying the name of the tag to match on. The special value
*” matches all tags.
namespaceURI – The namespace URI of the elements to match on. The special
value "*" matches all namespaces.
Return Value
An XMLDOMNodeList Object
that contains all the matched XMLDOMElement
Objects.
Example
var doc = new XML.DOMDocument;
doc.load("sample.xml");
var list = doc.getElementsByTagName("student");
println(list.length);
Output
5