GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  HTML::DOM::COLLECTION (3)

.ds Aq ’

NAME

HTML::DOM::Collection - A Perl implementation of the HTMLCollection interface

CONTENTS

VERSION

Version 0.056

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



DESCRIPTION

This 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).

CONSTRUCTOR

Normally 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

$collection->length Returns the number of items in the collection.
$collection->item($index) Returns item number $index, numbered from 0. Note that you call also use $collection->[$index] for short.
$collection->namedItem($name) Returns the item named $name. If an item with an ID of $name exists, that will be returned. Otherwise the first item whose name attribute is $name will be returned. You can also write $collection->{$name}.

SEE ALSO

HTML::DOM

HTML::DOM::NodeList

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 HTML::DOM::COLLECTION (3) 2016-02-28

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.