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-69
XMLDOMCDATASection Object
Syntax
var objXMLDOMText = oXMLDOMText.splitText(offset)
Parameters
offset (unsigned integer) – The offset at which to split, starting from 0.
Return Value
ObjectThe new text node.
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 node =
doc.documentElement.childNodes.item(1).childNodes.item(7);
var textNode = node.firstChild;
println("original text = " + textNode.data);
var n1 = textNode.splitText(3);
print("After splitText(3), firstChild becomes " +
node.firstChild.data + ", ");
println("second child becomes " +
node.firstChild.nextSibling.data + ".");
Output
original text = Female
After splitText(3), firstChild becomes Fem, second child
becomes ale.
XMLDOMCDATASection Object
The XMLDOMCDATASection objects refer to the data from an XML CDATA section.
These are used to escape blocks of text containing characters that would otherwise be
regarded as markup.
The string data associated with the CDATA section may contain characters that need to
be escaped when appearing in an XML document outside of a CDATA section.
Although the XMLDOMCDATASection object inherits all properties and methods from
the XMLDOMCharacterData Object
through the XMLDOMText Object, adjacent
CDATASection nodes are not merged by use of the XMLDOMElement.normalize()
methods.