Ionizor has asked for the wisdom of the Perl Monks concerning the following question:
The part I've snipped out just contains handlers for the various HTML elements in the file (s_h1 for an h1 start tag, e_h1 for an h1 end tag, etc.) and shouldn't affect the above section of script in any way. Does anyone know why this script doesn't work?use XML::Parser::PerlSAX; use XML::Handler::Subs # # initialize the parser # use XML::Parser::PerlSAX; my $parser = XML::Parser::PerlSAX->new( Handler => H1_grabber->new( ) + ); $parser->parse( Source => {SystemId => shift @ARGV} ); ## Handler object: H1_grabber ## package H1_grabber; use base( 'XML::Handler::Subs' ); sub new { my $type = shift; my $self = {@_}; return bless( $self, $type ); } # # handle start of document # sub start_document { SUPER::start_document( ); print "Summary of file:\n"; } <snip>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SAX XML-Handler-Subs and SUPER::
by chromatic (Archbishop) on Aug 10, 2002 at 17:04 UTC | |
by Ionizor (Pilgrim) on Aug 12, 2002 at 21:13 UTC |