<areashape="rect"id="node2"href="classxercesc_1_1DOMText.html"title="The DOMText interface inherits from DOMCharacterData and represents the textual content (termed chara..."alt=""coords="37,160,171,189"/><areashape="rect"id="node4"href="classxercesc_1_1DOMCharacterData.html"title="The DOMCharacterData interface extends DOMNode with a set of attributes and methods for accessing cha..."alt=""coords="8,83,200,112"/><areashape="rect"id="node6"href="classxercesc_1_1DOMNode.html"title="The DOMNode interface is the primary datatype for the entire Document Object Model."alt=""coords="35,5,173,35"/></map>
<p>The only delimiter that is recognized in a CDATA section is the "]]&gt;" string that ends the CDATA section. CDATA sections cannot be nested. Their primary purpose is for including material such as XML fragments, without needing to escape all the delimiters. </p>
<p>The <code>data</code> attribute of the <code><aclass="el"href="classxercesc_1_1DOMText.html"title="The DOMText interface inherits from DOMCharacterData and represents the textual content (termed chara...">DOMText</a></code> node holds the text that is contained by the CDATA section. Note that this may contain characters that need to be escaped outside of CDATA sections and that, depending on the character encoding ("charset") chosen for serialization, it may be impossible to write out some characters as part of a CDATA section. </p>
<p>The <code><aclass="el"href="classxercesc_1_1DOMCDATASection.html"title="CDATA sections are used to escape blocks of text containing characters that would otherwise be regard...">DOMCDATASection</a></code> interface inherits from the <code><aclass="el"href="classxercesc_1_1DOMCharacterData.html"title="The DOMCharacterData interface extends DOMNode with a set of attributes and methods for accessing cha...">DOMCharacterData</a></code> interface through the <code><aclass="el"href="classxercesc_1_1DOMText.html"title="The DOMText interface inherits from DOMCharacterData and represents the textual content (termed chara...">DOMText</a></code> interface. Adjacent <code><aclass="el"href="classxercesc_1_1DOMCDATASection.html"title="CDATA sections are used to escape blocks of text containing characters that would otherwise be regard...">DOMCDATASection</a></code> nodes are not merged by use of the <code>normalize</code> method of the <code><aclass="el"href="classxercesc_1_1DOMNode.html"title="The DOMNode interface is the primary datatype for the entire Document Object Model.">DOMNode</a></code> interface. Because no markup is recognized within a <code><aclass="el"href="classxercesc_1_1DOMCDATASection.html"title="CDATA sections are used to escape blocks of text containing characters that would otherwise be regard...">DOMCDATASection</a></code>, character numeric references cannot be used as an escape mechanism when serializing. Therefore, action needs to be taken when serializing a <code><aclass="el"href="classxercesc_1_1DOMCDATASection.html"title="CDATA sections are used to escape blocks of text containing characters that would otherwise be regard...">DOMCDATASection</a></code> with a character encoding where some of the contained characters cannot be represented. Failure to do so would not produce well-formed XML.One potential solution in the serialization process is to end the CDATA section before the character, output the character using a character reference or entity reference, and open a new CDATA section for any further characters in the text node. Note, however, that some code conversion libraries at the time of writing do not return an error or exception when a character is missing from the encoding, making the task of ensuring that data is not corrupted on serialization more difficult. </p>