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-68
XMLDOMComment Object
Example
var doc = new XML.DOMDocument;
doc.load("sample.xml");
var comment = doc.documentElement.previousSibling;
println(comment.substringData(0, 10));
Output
This is co
XMLDOMComment Object
The XMLDOMComment object refers to XML comment nodes in the DOM. The string
value contains all of the characters between the starting ‘<!--’ and ending ‘-->’.
This object has no unique properties or methods of its own, but inherits the properties
and methods from the XMLDOMCharacterData Object
.
XMLDOMText Object
The XMLDOMText object represents the textual content of XMLDOMElement Object
or XMLDOMAttribute Object
.
If there is no markup inside an XMLDOMElement object’s content, the text is contained
in a single object implementing the XMLDOMText object that is the only child of the
XMLDOMElement object.
If there is markup, it is parsed into a list of elements and XMLDOMText Object
nodes
that form the list of children of the XMLDOMElement object.
When a document is first made available through the DOM, there is only one
XMLDOMText node for each block of the text. You can create adjacent XMLDOMText
nodes that represent the contents of a given element without any intervening markup, but
you should be aware that since there is no way to represent the separations between
these nodes in XML, they will not persist between DOM editing sessions.
The normalize method on the XMLDOMElement object merges any such adjacent
XMLDOMText objects into a single node for each block of text; this is recommended
before employing operations that depend on a particular document structure.
The XMLDOMText object has those properties and methods defined for the
XMLDOMNode Object
and XMLDOMCharacterData Object.
Method
splitText
Breaks this node into two nodes at the specified offset, keeping both in the tree as
siblings. This node then only contains all the content up to the offset point. A new
node of the same nodeType, which is inserted as the next sibling of this node,
contains all the content at and after the offset point. When the offset is equal to the
length of this node, the new node has no data.