XML::Grove::Sub man page on OpenServer

Man page or keyword search:  
man Server   5388 pages
apropos Keyword Search (all sections)
Output format
OpenServer logo
[printable version]

XML::Grove::Sub(3)    User Contributed Perl Documentation   XML::Grove::Sub(3)

NAME
       XML::Grove::Sub - run a filter sub over a grove

SYNOPSIS
	use XML::Grove::Sub;

	# Using filter method on XML::Grove::Document or XML::Grove::Element:
	@results = $grove_object->filter(\&sub [, ...]);

	# Using an XML::Grove::Sub instance:
	$filterer = XML::Grove::Sub->new();
	@results = $grove_object->accept($filterer, \&sub [, ...]);

DESCRIPTION
       "XML::Grove::Sub" executes a sub, the filter, over all objects in a
       grove and returns a list of all the return values from the sub.	The
       sub is called with the grove object as it's first parameter and passing
       the rest of the arguments to the call to `"filter()"' or `"accept()"'.

EXAMPLE
       The following filter will return a list of all `"foo"' or `"bar"' ele-
       ments with an attribute `"widget-no"' beginning with `"A"' or `"B"'.

	 @results = $grove_obj->filter(sub {
	     my $obj = shift;

	     if ($obj->isa('XML::Grove::Element')
		 && (($obj->{Name} eq 'foo')
		     || ($obj->{Name} eq 'bar'))
		 && ($obj->{Attributes}{'widget-no'} =~ /^[AB]/)) {
		 return ($obj);
	     }
	     return ();
	 });

AUTHOR
       Ken MacLeod, ken@bitsko.slc.ut.us

SEE ALSO
       perl(1), XML::Grove(3), Data::Grove::Visitor(3)

       Extensible Markup Language (XML) <http://www.w3c.org/XML>

perl v5.8.8			  1999-08-25		    XML::Grove::Sub(3)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server OpenServer

List of man pages available for OpenServer

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net