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-23
Methods
Example
var doc = new XML.DOMDocument;
doc.validateOnParse = true;
doc.load("sample.xml");
var node =
doc.documentElement.childNodes.item(0).childNodes.item(0);
var comment = doc.createComment("New Comment");
node.appendChild(comment);
println(node.xml);
Output
<name>Jenny Mabry<!--New Comment--></name>
createDocumentFragment
Creates an empty XMLDOMDocumentFragment Object node. Creating a document
fragment with this method is the same as using createNode
where the type
parameter value is NODE_DOCUMENT_FRAGMENT 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
objFragment = doc.createDocumentFragment();
Parameters
None.
Return Value
objFragment – XMLDOMDocumentFragment Object
.
Example
var doc = new XML.DOMDocument;
doc.load("sample.xml");
var fragment = doc.createDocumentFragment();
println(fragment.nodeType);
Output
11
createElement
Creates an element using the supplied name and namespace. Creating an element
with this method is the same as using createNode where the type parameter value is
NODE_ELEMENT. 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
objElement = doc.createElement(tagName[, namespaceURI]);