Table 15-4 summarizes the methods of available through CharacterDataRef
interface.
Table 15-4 Summary of CharacterDataRef Methods; Dom Package
Function | Summary |
---|---|
appendData
|
Append data to end of node's current data. |
deleteData
|
Remove part of node's data. |
freeString
|
Deallocate the string allocated by substringData .
|
getData
|
Return node's data. |
getLength
|
Return length of node's data. |
insertData
|
Insert string into node's current data. |
replaceData
|
Replace part of node's data. |
setData
|
Set node's data. |
substringData
|
Get substring of node's data. |
Append a string to the end of a CharacterData
node's data. The appended data should be in the data encoding. It will not be verified, converted, or checked.
void appendData( oratext* data) throw (DOMException);
Parameter | Description |
---|---|
data |
data to append |
Remove a range of characters from a CharacterData
node's data. The offset is zero-based, so offset zero refers to the start of the data. Both offset and count are in characters, not bytes. If the sum of offset and count exceeds the data length then all characters from offset to the end of the data are deleted.
void deleteData( ub4 offset, ub4 count) throw (DOMException);
Parameter | Description |
---|---|
offset |
character offset where deletion starts |
count |
number of characters to delete |
Deallocates the string allocated by substringData(). It is Oracle's extension.
void freeString( oratext* str);
Parameter | Description |
---|---|
str |
string |
Returns the data for a CharacterData
node (type text, comment or CDATA) in the data encoding.
oratext* getData() const;
(oratext*)
node's data
Returns the length of the data for a CharacterData
node (type Text
, Comment
or CDATA
) in characters (not bytes).
ub4 getLength() const;
(ub4)
length in characters (not bytes!) of node's data
Insert a string into a CharacterData
node's data at the specified position. The inserted data must be in the data encoding. It will not be verified, converted, or checked. The offset is specified as characters, not bytes. The offset is zero-based, so inserting at offset zero prepends the data.
void insertData( ub4 offset, oratext* data) throw (DOMException);
Parameter | Description |
---|---|
offset |
character offset where insertion starts |
data |
data to insert |
Replaces a range of characters in a CharacterData
node's data with a new string. The offset is zero-based, so offset zero refers to the start of the data. The replacement data must be in the data encoding. It will not be verified, converted, or checked. The offset and count are both in characters, not bytes. If the sum of offset and count exceeds length, then all characters to the end of the data are replaced.
void replaceData( ub4 offset, ub4 count, oratext* data) throw (DOMException);
Parameter | Description |
---|---|
offset |
offset |
count |
number of characters to replace |
data |
data |
Sets data for a CharacterData
node (type text, comment or CDATA), replacing the old data. The new data is not verified, converted, or checked -- it should be in the data encoding.
void setData( oratext* data) throw (DOMException);
Parameter | Description |
---|---|
data |
data |
Returns a range of character data from a CharacterData
node (type Text
, Comment
or CDATA
). Since the data is in the data encoding, offset and count are in characters, not bytes. The beginning of the string is offset 0. If the sum of offset and count exceeds the length, then all characters to the end of the data are returned. The substring is permanently allocated in the context managed memory and should be explicitly deallocated by freeString
oratext* substringData( ub4 offset, ub4 count) throw (DOMException);
Parameter | Description |
---|---|
offset |
offset |
count |
number of characters to extract |
(oratext *)
specified substring