HTML::DOM::Text - A Perl class for representing text nodes in an HTML DOM tree


NAME

HTML::DOM::Text - A Perl class for representing text nodes in an HTML DOM tree


SYNOPSIS

  use HTML::DOM;
  $doc = HTML::DOM->new;
  $text_node = $doc->createTextNode('the text goes here, I think');
  $text_node->data;              # 'the text goes here, I think'
  $text_node->length;            #  27
  $text_node->substringData(22); # 'think' 
  # etc.


DESCRIPTION

This class implements the Text interface for the HTML::DOM manpage. It inherits from the HTML::DOM::CharacterData manpage, which inherits from the HTML::DOM::Node manpage.


METHODS

HTML::DOM::Text's Own Methods

$text->splitText($offset)

Splits the node into two separate sibling text nodes at the given offset.

$text->splitText16($offset)

This is just like splitText except that the offset is given in UTF-16, rather than Unicode.

$text->nodeName

This returns '#text'.

$text->nodeType

This returns the constant HTML::DOM::Node::TEXT_NODE.

Inherited Methods

These are inherited from the HTML::DOM::CharacterData manpage:

data
length
length16
substringData
substringData16
appendData
insertData
insertData16
deleteData
deleteData16
replaceData
replaceData16
nodeValue

These are inherited from the HTML::DOM::Node manpage:

nodeValue
parentNode
childNodes
firstChild
lastChild
previousSibling
nextSibling
attributes
ownerDocument
insertBefore
replaceChild
removeChild
appendChild
hasChildNodes
cloneNode


SEE ALSO

the HTML::DOM manpage

the HTML::DOM::CharacterData manpage

the HTML::DOM::Node manpage