November 2002
Intermediate to advanced
1120 pages
21h 2m
English
The Text interface represents a text node. This can be a child of an element, an attribute, or an entity reference. When a document is built by a parser, each text node will contain the longest possible run of contiguous parsed character data from the document, and thus no text node will be adjacent to any other. By contrast, documents built in memory may contain adjacent text nodes. Invoking the normalize() method in the Node interface on any ancestor of the text nodes will merge these together.
Example 11.9 summarizes the Text interface. In addition to methods such as setData() and getNodeValue() that Text inherits from its superinterfaces, it has one new method that splits a Text object into two.
Read now
Unlock full access