|
NAMEXML::SAX::EventMethodMaker - SAX event names, creation of methods from templates VERSIONversion 0.46 SYNOPSIS use XML::SAX::EventMethodMaker qw(
sax_event_names missing_methods compile_methods
);
## Getting event names by handler type and SAX version
my @events = sax_event_names;
my @dtd_events = sax_event_names "DTDHandler";
my @sax1_events = sax_event_names 1;
my @sax1_dtd_events = sax_event_names 1, "DTDHandler";
## Figuring out what events a class or object does not provide
my @missing = missing_methods $class, @events ;
## Creating all SAX event methods
compile_methods $class, <<'TEMPLATE_END', sax_event_names;
sub <EVENT> {
my $self = shift;
... do something ...
## Pass the event up to the base class
$self->SUPER::<EVENT>( @_ );
}
TEMPLATE_END
## Creating some methods
compile_methods $class, <<'TEMPLATE_END', @method_names;
...
TEMPLATE_END
## Creating only missing event handlers
compile_missing_methods $class, <<'TEMPLATE_END';
...
TEMPLATE_END
DESCRIPTIONIn building SAX machines, it is often handle to build a set of event handlers from a common template. This helper library (or class) provides the database of handler names, queryable by type, and NAMEXML::SAX::EventMethodMaker - SAX event names, creation of methods from templates Functions
Due CreditThe database of handlers by type was developed by Kip Hampton, modified by Robin Berjon, and pilfered and corrupted by me. LICENSE Database Copyright 2002, Barrie Slaymaker, Kip Hampton, Robin Berjon
Code Copyright 2002, Barrie Slaymaker <barries@slaysys.com>
You may use this under the terms of the Artistic, GNU Public, or BSD licences, as you see fit. AUTHORS
COPYRIGHT AND LICENSEThis software is copyright (c) 2013 by Barry Slaymaker. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
|