<h1>xercesc::DOMCharacterData Class Reference</h1><!-- doxytag: class="xercesc::DOMCharacterData" --><!-- doxytag: inherits="xercesc::DOMNode" -->The <code><aclass="el"href="classxercesc_1_1DOMCharacterData.html">DOMCharacterData</a></code> interface extends <aclass="el"href="classxercesc_1_1DOMNode.html">DOMNode</a> with a set of attributes and methods for accessing character data in the DOM.
Inheritance diagram for xercesc::DOMCharacterData:<p><center><imgsrc="classxercesc_1_1DOMCharacterData__inherit__graph.png"border="0"usemap="#xercesc_1_1DOMCharacterData__inherit__map"alt="Inheritance graph"></center>
<center><fontsize="2">[<ahref="graph_legend.html">legend</a>]</font></center><ahref="classxercesc_1_1DOMCharacterData-members.html">List of all members.</a><tableborder="0"cellpadding="0"cellspacing="0">
<tr><td></td></tr>
<tr><tdcolspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><tdcolspan="2"><divclass="groupHeader">Functions introduced in DOM Level 1</div></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the character data of the node that implements this interface. <ahref="#206d3789770c3b954c31b474500a281f"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the number of characters that are available through <code>data</code> and the <code>substringData</code> method below. <ahref="#81d21764639ffb42972a13974c5782a9"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Extracts a range of data from the node. <ahref="#869a1ef736e5c983f414e3863c4d46f5"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Append the string to the end of the character data of the node. <ahref="#b6f104b28b34c5aea4f7f3a095a55034"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Insert a string at the specified character offset. <ahref="#ae6f592e7aa9655ad29f6671fd2ab2f6"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Remove a range of characters from the node. <ahref="#8548264c0e7dc51a4120af074ff630bc"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Replace the characters starting at the specified character offset with the specified string. <ahref="#6d618a102fe3245bc89494fe34f1189c"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the character data of the node that implements this interface. <ahref="#c97dd1ac52e8618d29fde8fa9b7e294c"></a><br></td></tr>
The <code><aclass="el"href="classxercesc_1_1DOMCharacterData.html">DOMCharacterData</a></code> interface extends <aclass="el"href="classxercesc_1_1DOMNode.html">DOMNode</a> with a set of attributes and methods for accessing character data in the DOM.
<p>
For clarity this set is defined here rather than on each object that uses these attributes and methods. No DOM objects correspond directly to <code><aclass="el"href="classxercesc_1_1DOMCharacterData.html">DOMCharacterData</a></code>, though <code><aclass="el"href="classxercesc_1_1DOMText.html">DOMText</a></code> and others do inherit the interface from it. All <code>offsets</code> in this interface start from <code>0</code>. <p>
As explained in the DOM spec, text strings in the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In the following, the term 16-bit units is used whenever necessary to indicate that indexing on <aclass="el"href="classxercesc_1_1DOMCharacterData.html">DOMCharacterData</a> is done in 16-bit units. <p>
See also the <ahref="http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113">Document Object Model (DOM) Level 2 Core Specification</a>. <dlclass="since"compact><dt><b>Since:</b></dt><dd>DOM Level 1 </dd></dl>
The DOM implementation may not put arbitrary limits on the amount of data that may be stored in a <code><aclass="el"href="classxercesc_1_1DOMCharacterData.html">DOMCharacterData</a></code> node. However, implementation limits may mean that the entirety of a node's data may not fit into a single <code>XMLCh* String</code>. In such cases, the user may call <code>substringData</code> to retrieve the data in appropriately sized pieces. <dlcompact><dt><b>Exceptions:</b></dt><dd>
<tr><tdvalign="top"></td><tdvalign="top"><em><aclass="el"href="classxercesc_1_1DOMException.html">DOMException</a></em> </td><td>NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. </td></tr>
Returns the number of characters that are available through <code>data</code> and the <code>substringData</code> method below.
<p>
This may have the value zero, i.e., <code>CharacterData</code> nodes may be empty. <dlclass="since"compact><dt><b>Since:</b></dt><dd>DOM Level 1 </dd></dl>
<dlclass="return"compact><dt><b>Returns:</b></dt><dd>The specified substring. If the sum of <code>offset</code> and <code>count</code> exceeds the <code>length</code>, then all characters to the end of the data are returned. </dd></dl>
<tr><tdvalign="top"></td><tdvalign="top"><em><aclass="el"href="classxercesc_1_1DOMException.html">DOMException</a></em> </td><td>INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of characters in <code>data</code>, or if the specified <code>count</code> is negative. </td></tr>
Upon success, <code>data</code> provides access to the concatenation of <code>data</code> and the <code>XMLCh* String</code> specified. <dlcompact><dt><b>Parameters:</b></dt><dd>
<tr><tdvalign="top"></td><tdvalign="top"><em><aclass="el"href="classxercesc_1_1DOMException.html">DOMException</a></em> </td><td>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. </td></tr>
Insert a string at the specified character offset.
<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>offset</em> </td><td>The character offset at which to insert. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>arg</em> </td><td>The <code>XMLCh* String</code> to insert. </td></tr>
</table>
</dl>
<dlcompact><dt><b>Exceptions:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em><aclass="el"href="classxercesc_1_1DOMException.html">DOMException</a></em> </td><td>INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of characters in <code>data</code>. <br>
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>offset</em> </td><td>The offset from which to remove characters. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>count</em> </td><td>The number of characters to delete. If the sum of <code>offset</code> and <code>count</code> exceeds <code>length</code> then all characters from <code>offset</code> to the end of the data are deleted. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em><aclass="el"href="classxercesc_1_1DOMException.html">DOMException</a></em> </td><td>INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of characters in <code>data</code>, or if the specified <code>count</code> is negative. <br>
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>offset</em> </td><td>The offset from which to start replacing. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>count</em> </td><td>The number of characters to replace. If the sum of <code>offset</code> and <code>count</code> exceeds <code>length</code> , then all characters to the end of the data are replaced (i.e., the effect is the same as a <code>remove</code> method call with the same range, followed by an <code>append</code> method invocation). </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>arg</em> </td><td>The <code>XMLCh* String</code> with which the range must be replaced. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em><aclass="el"href="classxercesc_1_1DOMException.html">DOMException</a></em> </td><td>INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of characters in <code>data</code>, or if the specified <code>count</code> is negative. <br>
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. </td></tr>