XML DOM Text 对象

Text object

The Text object represents the text content of the element or attribute.

Properties of Text object

Attribute Description
data Set or return the text of the element or attribute.
isElementContentWhitespace Determine whether the text node contains whitespace characters.
length Return the text length of the element or attribute.
wholeText Return all text adjacent to the node, connected in document order.

Methods of Text object

Method Description
appendData() Append data to the node.
deleteData() Delete data from the node.
insertData() Insert data into the node.
replaceData() Replace the data in the node.
replaceWholeText(text) Replace the text of this node and all adjacent text nodes with the specified text.
splitText() Split a Text node into two.
substringData() Extract data from the node.