/usr/share/perl5/XML/Handler/Sample.pm is in libxml-perl 0.08-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | # This template file is in the Public Domain.
# You may do anything you want with this file.
#
# $Id: Sample.pm,v 1.4 1999/08/16 16:04:03 kmacleod Exp $
#
package XML::Handler::Sample;
use vars qw{ $AUTOLOAD };
sub new {
my $type = shift;
my $self = ( $#_ == 0 ) ? shift : { @_ };
return bless $self, $type;
}
# Basic PerlSAX
sub start_document { print "start_document\n"; }
sub end_document { print "end_document\n"; }
sub start_element { print "start_element\n"; }
sub end_element { print "end_element\n"; }
sub characters { print "characters\n"; }
sub processing_instruction { print "processing_instruction\n"; }
sub ignorable_whitespace { print "ignorable_whitespace\n"; }
# Additional expat callbacks in XML::Parser::PerlSAX
sub comment { print "comment\n"; }
sub notation_decl { print "notation_decl\n"; }
sub unparsed_entity_decl { print "unparsed_entity_decl\n"; }
sub entity_decl { print "entity_decl\n"; }
sub element_decl { print "element_decl\n"; }
sub doctype_decl { print "doctype_decl\n"; }
sub xml_decl { print "xml_decl\n"; }
# Additional SP/nsgmls callbacks in XML::ESISParser
sub start_subdoc { print "start_subdoc\n"; }
sub end_subdoc { print "start_subdoc\n"; }
sub appinfo { print "appinfo\n"; }
sub internal_entity_ref { print "sdata\n"; }
sub external_entity_ref { print "sdata\n"; }
sub record_end { print "record_end\n"; }
sub internal_entity_decl { print "internal_entity_decl\n"; }
sub external_entity_decl { print "external_entity_decl\n"; }
sub external_sgml_entity_decl { print "external_sgml_entity_decl\n"; }
sub subdoc_entity_decl { print "subdoc_entity_decl\n"; }
sub notation { print "notation\n"; }
sub error { print "error\n"; }
sub conforming { print "conforming\n"; }
# Others
sub AUTOLOAD {
my $self = shift;
my $method = $AUTOLOAD;
$method =~ s/.*:://;
return if $method eq 'DESTROY';
print "UNRECOGNIZED $method\n";
}
1;
__END__
=head1 NAME
XML::Handler::Sample - a trivial PerlSAX handler
=head1 SYNOPSIS
use XML::Parser::PerlSAX;
use XML::Handler::Sample;
$my_handler = XML::Handler::Sample->new;
XML::Parser::PerlSAX->new->parse(Source => { SystemId => 'REC-xml-19980210.xml' },
Handler => $my_handler);
=head1 DESCRIPTION
C<XML::Handler::Sample> is a trivial PerlSAX handler that prints out
the name of each event it receives. The source for
C<XML::Handler::Sample> lists all the currently known PerlSAX
handler methods.
C<XML::Handler::Sample> is intended for Perl module authors who wish
to look at example PerlSAX handler modules. C<XML::Handler::Sample>
can be used as a template for writing your own PerlSAX handler
modules. C<XML::Handler::Sample> is in the Public Domain and can be
used for any purpose without restriction.
=head1 AUTHOR
Ken MacLeod, ken@bitsko.slc.ut.us
=head1 SEE ALSO
perl(1), PerlSAX.pod(3)
=cut
|