The CharacterData Interface

The CharacterData interface is a generic superinterface for nodes that are composed mostly of text, including Text, CDATASection, and Comment. The CharacterData interface is almost never used directly. Rather, it is used as an instance of one of these three subinterfaces. But you almost always work with text, CDATA section, and comment nodes using the methods of the CharacterData interface.

Example 11.7 summarizes the CharacterData interface. This interface has methods that manipulate the text content of this node. As usual, it also inherits all the methods of its superinterface Node such as getParentNode() and getNodeValue().

Example 11.7. The CharacterData Interface
 package org.w3c.dom; public interface CharacterData ...

Get Processing XML with Java™: A Guide to SAX, DOM, JDOM, JAXP, and TrAX 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.