Text Nodes

The ensure interoperability, the DOM defines a standard data type for representing character data in a source document. The DOM defines the DOMString as asequence of 16-bit units (encoded using UTF-16) for this purpose.[10] The DOM also defines a generic CharacterData interface deriving from Node that encapsulates DOMString and provides behavior for inserting, appending, replacing, and deleting the DOMString's value. All other DOM interfaces that deal directly with character data extend the CharacterData interface, which itself extends Node.

[10] As stated in the DOM specification, DOM implementations are required to encode DOMString's using UTF-16 because of its widespread industry practice. However, because XML' character set is ...

Get Essential XML: Beyond Markup now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.