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-66
Methods
Parameters
offset (unsigned integer) – The character offset at which to insert.
data (string) – The string value to insert.
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.insertData(8, "<insert>");
println(comment.data);
Output
This is <insert>comment line
replaceData
Replaces the characters starting at the specified character offset with the specified 
string.
Syntax
oXMLCharacterData.replaceData(offset, count, data)
Parameters
offset (unsigned integer) – The character offset at which to begin replacing.
count (unsigned integer) – The number of characters to replace. If the sum of 
offset and count exceeds the property length value, then all characters to the 
end of the data are replaced (that is, the effect is the same as a remove method call 
with the same range, followed by an append method invocation).
data (string) – The string value to insert.
Return Value
None.










