In this tutorial, we will implement append() method of CDATA class. The
CDATA class is available
in org.jdom package. The append( java.lang.String string) method will append character data with
in this CDATA node.
In this example, we can create a CDATA node with the help CDATA class. The CDATA(java.lang.String string) constructor of CDATA class crates a CDATA new node with a string.
The setContent(Content content ) method of Element class is used to set the content at element.Code:
<?xml version="1.0" encoding="UTF-8"?>
<![CDATA[<Detail>java is a programming book.</Detail>.It support oops concept.]]></book>
<book name="c" /> </BookCatalog>
Charater data : <Detail>java is a programming book.</Detail>.It support oops concept.
Ask your questions, our development team will try to give answers to your questions.