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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.