Class DOMIT_CharacterData
A class representing the DOM CharacterData interface, used to manipulate DOM strings (not present in DOMIT! Lite).

isPublic? yes
isAbstract? yes

Inheritance tree:


DOMIT_Node
|
DOMIT_CharacterData

Known subclasses:

DOMIT_TextNode, DOMIT_CDATASection

Source file: xml_domit_parser.php




Constructor



Public Constants



Private Constants



Public Fields



Private Fields



Public Methods
getData
Returns the data (i.e., nodeValue) contained in the text node.

Signature: getData()

Returns:

String - The text data contained in the node.

Example:

The text data in the text node will be returned:

$myText = $aTextNode->getData();

getLength
Returns the number of characters in the text node.

Signature: getLength()

Returns:

int - The number of characters in the text node.

Example:

The number of characters in the text node will be returned:

$totalChars = $aTextNode->getLength();

substringData
Returns the specified subset of data from the text node.

Signature: substringData($offset, $count)

Parameters:

int offset - The index at which the substring is to begin.

int count - The number of characters from the offset to include.

Returns:

String - The requested subset.

Example:

The second and third characters in the text node will be returned:

$myChars = $aTextNode->substringData(1,2);

appendData
Appends the specified subset of data to the text node.

Signature: appendData($arg)

Parameters:

String arg - The text data to be added to the text node.

insertData
Inserts text data at the specified offset.

Signature: insertData($offset, $arg)

Parameters:

int offset - The offset at which the text data should be inserted.

String arg - The text data to insert.

Example:

The word "Hello, " will be inserted at the beginning to the node text:

$aTextNode->insertData(0,"Hello, ");

deleteData
Deletes the specified substring from the text data of the node.

Signature: deleteData($offset, $count)

Parameters:

int offset - The index at which the substring is to begin.

int count - The number of characters from the offset to delete.

Example:

The second and third characters in the text node will be deleted:

$aTextNode->deleteData(1,2);

replaceData
Replaces the specified subset of data with new text.

Signature: replaceData($offset, $count, $arg)

Parameters:

int offset - The index at which the substring is to begin.

int count - The number of characters from the offset to replace.

String arg - The replacement text.

Example:

The second and third characters in the text node will be replaced by the word "Hello":

$aTextNode->replaceData(1,2, "Hello");




Private Methods

Documentation generated by ClassyDoc, using the DOMIT! and SAXY parsers.
Please visit Engage Interactive to download free copies.