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-15
Methods
Syntax
var oRemoveNode = oNode.removeChild(oldChild)
Parameters
oldChild – The node to remove.
Return Value
oRemoveNode – The node removed.
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) – 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 oldChild = root.removeChild(root.childNodes.item(1));
println("There are " + root.childNodes.length + "
childNodes");
Output
There are 4 childNodes
replaceChild
Replaces the child node oldChild with newChild in the list of children, and
returns the oldChild node. If newChild is an XMLDOMDocumentFragment
Object, oldChild is replaced by all of the XMLDOMDocumentFragment
children, which are inserted in the same order. If newChild is already in the tree, it
is first removed.
Syntax
var oReplaced= oNode.replaceChild(newChild, oldChild)
Parameters
newChild – The new node to put in the child list.
oldChild – The node being replaced in the list.
Return Value
oReturn – The node replaced.