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-51
Methods
normalize
Normalizes all descendant elements; combines two or more adjacent text nodes into
one unified text node. This method puts all XMLDOMText nodes in the full depth of
the subtree underneath the XMLDOMElement object into a normal form where only
markup (for example, tags, comments, processing instructions, CDATA sections, and
entity references) separates XMLDOMText nodes. For example, there are neither
adjacent XMLDOMText nodes nor empty XMLDOMText nodes. This can be used
to ensure that the DOM view of a document is the same as if it were saved and
reloaded, and is useful when operations that depend on a particular document tree
structure are to be used.
Syntax
var objXMLDOMElement = oXMLDOMElement.normalize()
Parameters
None.
Example
var doc = new XML.DOMDocument;
doc.load("sample.xml");
var root = doc.documentElement;
println(root.normalize());
Output
true
removeAttribute
Removes an attribute by name. If the removed attribute is known to have a default
value, an attribute immediately appears containing the default value as well as the
corresponding namespace URI, local name, and prefix when applicable.
Syntax
oXMLDOMElement.removeAttribute(name)
Parameters
name – The name of the attribute to remove.
Return Value
None.
ATPException
The following list shows the possible error-detail codes for the ATPException,
where error code is equal to ATP_ERR_DOM_EXCEPTION.
β€’
NO_MODIFICATION_ALLOWED_ERR(7): This error-detail code indicates
that the nodeValue attribute is read-only.