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-65
Methods
Output
This is comment line; here is appended data
deleteData
Removes a range of characters from the node. Upon success, the data and
length properties reflect the change.
Syntax
oXMLCharacterData.deleteData(offset, count)
Parameters
offset (unsigned integer) – The offset from which to remove characters.
count (unsigned integer) – The number of characters to delete. If the sum of
offset and count exceeds length then all characters from offset to the end
of the data are deleted.
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.
INDEX_SIZE_ERR(1): This error-detail code is raised if the specified offset is
negative or greater than the number of characters in data, or if the specified
count is negative.
NO_MODIFICATION_ALLOWED_ERR(7): This error-detail code indicates
that the node is read-only.
Example
var doc = new XML.DOMDocument;
doc.load("sample.xml");
var comment = doc.documentElement.previousSibling;
comment.deleteData(0, 6);
println(comment.data);
Output
s comment line
insertData
Inserts a string at the specified character offset.
Syntax
oXMLCharacterData.insertData(offset, data)