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

XML for ATP Add-On Module
iTP Active Transaction Pages (iTP ATP) Programmer’s Guideβ€”522292-002
5-30
Methods
Example
var doc = new XML.DOMDocument;
doc.loadXML("<employee><id>0001</id><name>Joe</name>
</employee>");
println(doc.xml);
Output
<employee><id>0001</id><name>Joe</name></employee>
nodeFromID
Returns the node whose ID is given by the supplied string. The ID is specified in the
DTD. The ID is for the attribute in each element, and no element can specify more
than one ID attribute. If no ID is specified, null is returned. This method is an
extension of the W3C DOM.
Syntax
oNode = doc.nodeFromID(strID);
Parameters
strID – The unique ID value for an element.
Return Value
oNode – The matching node.
Example
var doc = new XML.DOMDocument;
doc.load("sample.xml");
var node = doc.nodeFromID("NUM16004");
println(node.xml);
Output
<student id="NUM16004">
<name>Maria Jones</name>
<department>Electrical Engineering</department>
<GPA>3.7</GPA>
<gender>Female</gender>
<address street="Yes" permanent="Yes">277 South Road.
Sunnyvale, California 94087</address>
</student>
save
Saves an XML document to the specified location. The file is created if necessary
and the contents are entirely replaced with the contents of the saved document.
Syntax
doc.save(filename);