The CDATA Class

The CDATA class shown in Example 15.13 is a subclass of Text with almost no functionality of its own. The only difference between CDATA and Text is that when an XMLOutputter serializes a CDATA object, it places its contents in a CDATA section rather than escaping reserved characters such as the less-than symbol with character or entity references.

Example 15.13. The JDOM CDATA Class
package org.jdom;

public class CDATA extends Text {

  protected CDATA() { }
  public    CDATA(String s) throws IllegalDataException;

  public Text setText(String s) throws IllegalDataException;
  public void append(String s) throws IllegalDataException;

  public String toString();

}

In my opinion, you really shouldn't use this class at all. The builder may (or ...

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.