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-43
Methods
Example
var doc = new XML.DOMDocument;
doc.validateOnParse = true;
doc.load("sample.xml");
root = doc.documentElement;
var map =
root.childNodes.item(0).childNodes.item(4).attributes;
var attr = map.removeQualifiedItem("street", "");
println(attr.nodeValue);
Output
Yes
setNamedItem
Adds a node using its nodeName attribute. As the node name attribute is used to
derive the name which the node must be stored under, multiple nodes of certain
types (those that have a “special” string value) cannot be stored as the names would
clash. This is seen as preferable to allowing nodes to be aliased.
Syntax
var objXMLDOMNode = oXMLDOMNamedNodeMap.setNamedItem(newItem)
Parameters
newItem – A node to store in a named node map. The node will later be accessible
using the value of the nodeName attribute of the node. If a node with that name is
already present in the map, it is replaced by the new one.
Return Value
ObjectThe XMLDOMNode replaced by the new item with the same
nodeName, otherwise null is returned.
ATPException
The following list shows the possible error-detail codes for the ATPException,
where error code is equal to ATP_ERR_DOM_EXCEPTION.
WRONG_DOCUMENT_ERR(4): This error-detail code is raised if newItem
was created from a different document than the one that created the
XMLDOMNamedNodeMap object.
NO_MODIFICATION_ALLOWED_ERR(7): This error-detail code indicates
that the name node map is read-only.
INUSE_ATTRIBUTE_ERR(10): Raised if arg is an Attr that is already an
attribute of another Element object. The DOM user must explicitly clone Attr
nodes to re-use them in other elements.