Mozilla-DOM

 view release on metacpan or  search on metacpan

lib/Mozilla/DOM/Node.pod  view on Meta::CPAN


Pass this to QueryInterface.

=head1 ATTRIBUTES

=head2 $namednodemap = $node->B<GetAttributes>()

A L<Mozilla::DOM::NamedNodeMap|Mozilla::DOM::NamedNodeMap> containing
the attributes of this node (if it is an Element) or null otherwise.

In list context, returns a list of L<Mozilla::DOM::Attr|Mozilla::DOM::Attr>,
instead. (I considered returning a hash ($attr->GetName => $attr->GetValue),
but then you couldn't set the attributes.)

=head2 $bool = $node->B<HasAttributes>()

Returns whether this node (if it is an element) has any attributes.

=head2 $nodelist = $node->B<GetChildNodes>()

A L<Mozilla::DOM::NodeList|Mozilla::DOM::NodeList> that contains all children
of this node. If there are no children, this is a NodeList containing no nodes.

In list context, this returns a list of L<Mozilla::DOM::Node|Mozilla::DOM::Node>,
instead.

=head2 $bool = $node->B<HasChildNodes>()

This is a convenience method to allow easy determination of whether a
node has any children.

=head2 $node = $node->B<GetFirstChild>()

The first child of this node. If there is no such node, this returns null.

=head2 node = $node->B<GetLastChild>

The last child of this node. If there is no such node, this returns null.

=head2 $node = $node->B<GetPreviousSibling>()

The node immediately preceding this node. If there is no such node,
this returns null.

=head2 $node = $node->B<GetNextSibling>()

The node immediately following this node. If there is no such node, this returns null.

=head2 $name = $node->B<GetNodeName>()

The name of this node, depending on its type:

=over

=item Attr

The name of the attribute

=item CDATASection

#cdata-section

=item Comment

#comment

=item Document

#document

=item DocumentFragment

#document-fragment

=item DocumentType

The document type name

=item Element

The tag name

=item Entity

The entity name

=item EntityReference

The name of the entity referenced

=item Notation

The name of the notation

=item ProcessingInstruction

The target

=item Text

#text

=back

=head2 $type = $node->B<GetNodeType>()

Matches one of the following constants,
which you can export with C<use Mozilla::DOM::Node qw(:types)>,
or export them individually.

=over 4

=item ATTRIBUTE_NODE

The node is a L<Mozilla::DOM::Attr>.

=item CDATA_SECTION_NODE

The node is a L<Mozilla::DOM::CDATASection>.

=item COMMENT_NODE



( run in 0.509 second using v1.01-cache-2.11-cpan-600a1bdf6e4 )