Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
HTML::DOM::NodeList::MUser(Contributed Perl DocumHTML::DOM::NodeList::Magic(3)

NAME
       HTML::DOM::NodeList::Magic - Magical node list class for	HTML::DOM

VERSION
       Version 0.058

SYNOPSIS
	 use HTML::DOM;
	 $doc =	HTML::DOM->new;

	 $list = $doc->getElementsByTagName('p');
	   # returns an	HTML::DOM::NodeList::Magic object

	 # OR:
	 use HTML::DOM::NodeList::Magic;
	 $list = new HTML::DOM::NodeList::Magic::
	     sub {
		 # ... return a	list of	items ...
	     },
	     $doc;

	 $list->[0];	 # first node
	 $list->item(0); # same

	 $list->length;	# same as scalar @$list

DESCRIPTION
       See HTML::DOM::NodeList both for	a description and the API.

       There is	one difference,	though:	If you want to create a	NodeList
       yourself, for whatever reason, you can call the constructor shown in
       the synopsis.  The subroutine has to return the entire list that	the
       node list is supposed to	contain.  The second argument is the document
       to which	the node belongs.  If the document is modified,	the node list
       is automatically	notified, and calls the	subroutine again the next time
       it is accessed, to reset	itself.	 If you	don't provide the document,
       the node	list will never	be updated after the first time	an element is
       accessed.

SEE ALSO
       HTML::DOM

       HTML::DOM::NodeList

perl v5.32.1			  2018-02-02	 HTML::DOM::NodeList::Magic(3)

NAME | VERSION | SYNOPSIS | DESCRIPTION | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=HTML::DOM::NodeList::Magic&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help