NAME

  XML::GDOME::CharacterData - Interface CharacterData implementation.

SYNOPSIS

  $str = $cd->getData();
         $cd->setData($str);
  $int = $cd->getLength();
         $cd->appendData($arg);
         $cd->deleteData($offset,$count);
         $cd->insertData($offset,$arg);
         $cd->replaceData($offset,$count,$arg);
  $str = $cd->substringData($offset,$count);

CLASS INHERITANCE

XML::GDOME::Node > XML::GDOME::CharacterData

METHODS

$str = $cd->getData();

Returns: the character data of the node that implements this interface.

$int = $cd->getLength();

Returns: The number of characters that are available. This may have the value zero, i.e., CharacterData nodes may be empty.

$cd->appendData($arg);

Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the string specified.

arg: The string to append

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.

$cd->deleteData($offset,$count);

Remove a range of characters from the node. If the sum of offset and count exceeds length then all characters from offset to the end of the data are deleted. Upon success, data and length reflect the change.

offset: The offset from which to start removing

count: The number of characters to delete.

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of characters in data.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.

$cd->insertData($offset,$arg);

Insert a string at the specified character offset.

offset: The character offset at which to insert

arg: The string to insert

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of characters in data.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.

$cd->replaceData($offset,$count,$arg);

Replace the characters starting at the specified character offset with the specified string. If the sum of offset and count exceeds length, then all characters to the end of the data are replaced;

offset: The offset from which to start replacing

count: The number of characters to replace.

arg: The String with which the range must be replaced

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of characters in data.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.

$str = $cd->substringData($offset,$count);

Extracts a range of data from the node.

offset: Start offset of substring to extract

count: The number of characters to extract

Returns: The specified substring. If the sum of offset and count exceeds the length, then all characters to the end of the data are returned.

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of characters in data.