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-12
Methods
ATPException
The following list shows the possible error-detail codes for the ATPException,
where error code is equal to ATP_ERR_DOM_EXCEPTION.
•
HIERARCHY_REQUEST_ERR(3): Raised if this node is of a type that does
not allow children of the type of the newChild node, or if the node to append is
one of this node’s ancestors.
•
WRONG_DOCUMENT_ERR(4): Raised if newChild was created from a
different document than the one that created this node.
•
NO_MODIFICATION_ALLOWED_ERR(7): Raised if this node or the node
being appended is read-only.
Example
var domDoc = new XML.DOMDocument;
domDoc.validateOnParse = true;
domDoc.load("sample.xml");
var root = domDoc.documentElement;
var newNode = domDoc.createNode(1, "newNode");
root.appendChild(newNode);
println("There are " + root.childNodes.length + "
childNodes");
Output
There are 6 childNodes
cloneNode
Returns a duplicate of this node. The duplicate node has no parent. Cloning an
XMLDOMElement Object copies all attributes and their values, including those
generated by the XML processor to represent defaulted attributes, but this method
does not copy any text it contains unless it is a deep clone, since the text is
contained in a child text node. Cloning any other type of node simply returns a copy
of this node.
Syntax
var oClone = oNode.cloneNode(deep)
Parameters
deep – if true, recursively clone the subtree under the specific node; if false, clone
only the node itself (and its attributes, if it is an XMLDOMElement Object
).
Return Value
oClone – The duplicate node.