NAME
Mojo::DOM::Node - DOM Node
SYNOPSIS
use Mojo::DOM::Node;
my $node = Mojo::DOM::Node->new(parent => $parent, tree => $tree);
say $node->content;
DESCRIPTION
Mojo::DOM::Node is a container for nodes used by Mojo::DOM.
ATTRIBUTES
Mojo::DOM::Node implements the following attributes.
parent
my $parent = $node->parent;
$node = $node->parent(Mojo::DOM->new);
Mojo::DOM object for parent of this node.
tree
my $tree = $node->tree;
$node = $node->tree(['text', 'foo']);
Document Object Model. Note that this structure should only be used very carefully since it is very dynamic.
METHODS
Mojo::DOM::Node inherits all methods from Mojo::Base and implements the following new ones.
content
my $content = $node->content;
$node = $node->content('foo');
my $content = "$node";
Node content.
node
my $type = $node->node;
Node type, usually cdata
, comment
, doctype
, pi
, raw
or text
.
remove
my $parent = $node->remove;
Remove node and return Mojo::DOM object for parent of node.