Oracle® Database XML C++ API Reference 11g Release 1 (11.1) Part Number B28389-01 |
|
|
View PDF |
Table 2-4 summarizes the methods available through CharacterDataRef
interface.
Table 2-4 Summary of CharacterDataRef Methods; Dom Package
Function | Summary |
---|---|
|
Append data to end of node's current data. |
|
Remove part of node's data. |
|
Deallocate the string allocated by |
|
Return node's data. |
|
Return length of node's data. |
|
Insert string into node's current data. |
|
Replace part of node's data. |
|
Set node's data. |
|
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.
Syntax
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.
Syntax
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.
Syntax
void freeString( oratext* str);
Parameter | Description |
---|---|
str |
string |
Returns the data for a CharacterData
node (type text, comment or CDATA) in the data encoding.
Syntax
oratext* getData() const;
Returns
(oratext*)
node's data
Returns the length of the data for a CharacterData
node (type Text
, Comment
or CDATA
) in characters (not bytes).
Syntax
ub4 getLength() const;
Returns
(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.
Syntax
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.
Syntax
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.
Syntax
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
Syntax
oratext* substringData( ub4 offset, ub4 count) throw (DOMException);
Parameter | Description |
---|---|
offset |
offset |
count |
number of characters to extract |
Returns
(oratext *)
specified substring