NAME
HTML::DOM::CharacterData - A base class shared by HTML::DOM::Text and ::Comment
DESCRIPTION
This class provides those methods that are shared both by comments and text nodes in an HTML DOM tree.
METHODS
Attributes
The following DOM attributes are supported:
- data
-
The textual data that the node contains.
- length
-
The number of characters in
data. - length16
-
A standards-compliant version of
lengththat counts UTF-16 bytes instead of characters.
Other Methods
- substringData ( $offset, $length )
-
Returns a substring of the data. If
$lengthis omitted, all characters from$offsetto the end of the data are returned. - substringData16
-
A UTF-16 version of
substringData. - appendData ( $str )
-
Appends
$strto the node's data. - insertData ( $offset, $str )
-
Inserts
$strat the given$offset, which is understood to be the number of Unicode characters from the beginning of the node's data. - insertData16
-
Like
insertData, but$offsetis taken to be the number of UTF-16 (16-bit) bytes. - deleteData ( $offset, $length )
-
Deletes the specified data. If
$lengthis omitted, all characters from$offsetto the end of the node's data are deleted. - deleteData16
-
A UTF-16 version of the above.
- replaceData ( $offset, $length, $str )
-
This replaces the substring specified by
$offsetand$lengthwith$str.