Mojo::DOM::Node - DOM Node
use Mojo::DOM::Node; my $node = Mojo::DOM::Node->new(parent => $parent, tree => $tree); say $node->content;
Mojo::DOM::Node is a container for nodes used by Mojo::DOM.
Mojo::DOM::Node implements the following attributes.
my $parent = $node->parent; $node = $node->parent(Mojo::DOM->new);
Mojo::DOM object for parent of this node.
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.
Mojo::DOM::Node inherits all methods from Mojo::Base and implements the following new ones.
my $content = $node->content; $node = $node->content('foo');
Node content.
my $type = $node->node;
Node type, usually cdata, comment, doctype, pi, raw or text.
cdata
comment
doctype
pi
raw
text
my $parent = $node->remove;
Remove node and return Mojo::DOM object for parent of node.
Mojo::DOM::Node overloads the following operators.
my $bool = !!$node;
Always true.
my $content = "$node";
Alias for "content".
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
To install Mojolicious, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious
CPAN shell
perl -MCPAN -e shell install Mojolicious
For more information on module installation, please visit the detailed CPAN module installation guide.