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-22
Methods
Syntax
objCDATASection = doc.createCDATASection(data);
Parameters
data – The data for CDATA section contents.
Return Value
objCDATASectionXMLDOMCDATASection Object
.
ATPException
The following list shows the possible error-detail codes for the ATPException,
where error code is equal to ATP_ERR_DOM_EXCEPTION.
NOT_SUPPORTED_ERR(9): Raised if this document is an HTML document.
Example
var doc = new XML.DOMDocument;
doc.validateOnParse = true;
doc.load("sample.xml");
var node =
doc.documentElement.childNodes.item(0).childNodes.item(0);
var newCDATA = doc.createCDATASection("New CDATA Section");
node.appendChild(newCDATA);
println(node.xml);
Output
<name>Jenny Mabry<![CDATA[New CDATA Section]]></name>
createComment
Creates a XMLDOMComment Object node that contains the supplied data. Creating
a comment with this method is the same as using createNode where the type
parameter value is NODE_COMMENT and no namespace is specified. Although
this method creates the new object in the context of this document, it does not
automatically add the new object to the document tree.
Syntax
objComment = doc.createComment(data);
Parameters
data – String specifying the value to be supplied to the new XMLDOMComment
Object nodeValue property.
Return Value
objCommentXMLDOMComment Object
.