|
NAMEHTML::DOM::Collection - A Perl implementation of the HTMLCollection interface VERSIONVersion 0.058 SYNOPSIS use HTML::DOM;
$doc = HTML::DOM->new;
$doc->write('<html> ..... </html>');
$doc->close;
$images = $doc->images; # returns an HTML::DOM::Collection
$images->[0]; # first image
$images->{logo}; # image named 'logo'
$images->item(0);
$images->namedItem('logo');
$images->length; # same as scalar @$images
DESCRIPTIONThis implements the HTMLCollection interface as described in the W3C's DOM standard. This class is actually just a wrapper around the NodeList classes. In addition to the methods below, you can use a collection as a hash and as an array (both read-only). CONSTRUCTORNormally you would simply call a method that returns an HTML collection (as in the "SYNOPSIS"). But if you wall to call the constructor, here is the syntax: $collection = HTML::DOM::Collection->new($nodelist) $nodelist should be a node list object. OBJECT METHODS
SEE ALSOHTML::DOM HTML::DOM::NodeList
|