r10491 - in /branches/upstream/libxml-handler-printevents-perl: ./ current/ current/Changes current/MANIFEST current/Makefile.PL current/PrintEvents.pm current/README current/test.pl
vdanjean at users.alioth.debian.org
vdanjean at users.alioth.debian.org
Sat Dec 1 12:31:20 UTC 2007
Author: vdanjean
Date: Sat Dec 1 12:31:20 2007
New Revision: 10491
URL: http://svn.debian.org/wsvn/?sc=1&rev=10491
Log:
[svn-inject] Installing original source of libxml-handler-printevents-perl
Added:
branches/upstream/libxml-handler-printevents-perl/
branches/upstream/libxml-handler-printevents-perl/current/
branches/upstream/libxml-handler-printevents-perl/current/Changes
branches/upstream/libxml-handler-printevents-perl/current/MANIFEST
branches/upstream/libxml-handler-printevents-perl/current/Makefile.PL
branches/upstream/libxml-handler-printevents-perl/current/PrintEvents.pm
branches/upstream/libxml-handler-printevents-perl/current/README
branches/upstream/libxml-handler-printevents-perl/current/test.pl
Added: branches/upstream/libxml-handler-printevents-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libxml-handler-printevents-perl/current/Changes?rev=10491&op=file
==============================================================================
--- branches/upstream/libxml-handler-printevents-perl/current/Changes (added)
+++ branches/upstream/libxml-handler-printevents-perl/current/Changes Sat Dec 1 12:31:20 2007
@@ -1,0 +1,6 @@
+Revision history for Perl extension XML::Handler::PrintEvents.
+
+0.01 Sun Aug 26 11:07:45 2001
+ - original version; created by h2xs 1.21 with options
+ -X -n XML::Handler::PrintEvents
+
Added: branches/upstream/libxml-handler-printevents-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libxml-handler-printevents-perl/current/MANIFEST?rev=10491&op=file
==============================================================================
--- branches/upstream/libxml-handler-printevents-perl/current/MANIFEST (added)
+++ branches/upstream/libxml-handler-printevents-perl/current/MANIFEST Sat Dec 1 12:31:20 2007
@@ -1,0 +1,6 @@
+Changes
+Makefile.PL
+MANIFEST
+PrintEvents.pm
+README
+test.pl
Added: branches/upstream/libxml-handler-printevents-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libxml-handler-printevents-perl/current/Makefile.PL?rev=10491&op=file
==============================================================================
--- branches/upstream/libxml-handler-printevents-perl/current/Makefile.PL (added)
+++ branches/upstream/libxml-handler-printevents-perl/current/Makefile.PL Sat Dec 1 12:31:20 2007
@@ -1,0 +1,8 @@
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+ 'NAME' => 'XML::Handler::PrintEvents',
+ 'VERSION_FROM' => 'PrintEvents.pm', # finds $VERSION
+ 'PREREQ_PM' => {XML::Filter::SAXT => 0},
+);
Added: branches/upstream/libxml-handler-printevents-perl/current/PrintEvents.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libxml-handler-printevents-perl/current/PrintEvents.pm?rev=10491&op=file
==============================================================================
--- branches/upstream/libxml-handler-printevents-perl/current/PrintEvents.pm (added)
+++ branches/upstream/libxml-handler-printevents-perl/current/PrintEvents.pm Sat Dec 1 12:31:20 2007
@@ -1,0 +1,72 @@
+#
+# This PerlSAX handler prints out all the PerlSAX events/callbacks
+# it receives. Very useful when debugging.
+#
+
+package XML::Handler::PrintEvents;
+use strict;
+use XML::Filter::SAXT;
+
+use vars qw($VERSION);
+$VERSION = 0.01;
+
+my @EXTRA_HANDLERS = ( 'ignorable_whitespace' );
+
+sub new
+{
+ my ($class, %options) = @_;
+ bless \%options, $class;
+}
+
+sub print_event
+{
+ my ($self, $event_name, $event) = @_;
+
+ printf "%-22s ", $event_name;
+ if (defined $event)
+ {
+ print join (", ", map { "$_ => [" .
+ (defined $event->{$_} ? $event->{$_} : "(undef)")
+ . "]" } keys %$event);
+ }
+ print "\n";
+}
+
+#
+# This generates the PerlSAX handler methods for PrintEvents.
+# They basically forward the event to print_event() while adding the callback
+# (event) name.
+#
+for my $cb (@EXTRA_HANDLERS, map { @{$_} } values %XML::Filter::SAXT::SAX_HANDLERS)
+{
+ eval "sub $cb { shift->print_event ('$cb', \@_) }";
+}
+
+1; # package return code
+
+__END__
+
+=head1 NAME
+
+XML::Handler::PrintEvents - Prints PerlSAX events (for debugging)
+
+=head1 SYNOPSIS
+
+use XML::Handler::PrintEvents;
+
+my $pr = new XML::Handler::PrintEvents;
+
+=head1 DESCRIPTION
+
+This PerlSAX handler prints the PerlSAX events it receives to STDOUT.
+It can be useful when debugging PerlSAX filters.
+It supports all PerlSAX handler including ignorable_whitespace.
+
+=head1 AUTHOR
+
+Enno Derksen is the original author.
+
+Send bug reports, hints, tips, suggestions to T.J. Mather at
+<F<tjmather at tjmather.com>>.
+
+=cut
Added: branches/upstream/libxml-handler-printevents-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/libxml-handler-printevents-perl/current/README?rev=10491&op=file
==============================================================================
--- branches/upstream/libxml-handler-printevents-perl/current/README (added)
+++ branches/upstream/libxml-handler-printevents-perl/current/README Sat Dec 1 12:31:20 2007
@@ -1,0 +1,23 @@
+XML::Handler::PrintEvents version 0.01
+======================================
+
+DESCRIPTION
+
+This PerlSAX handler prints the PerlSAX events it receives to STDOUT. It can be useful when debugging PerlSAX
+filters. It supports all PerlSAX handler including ignorable_whitespace.
+
+INSTALLATION
+
+To install this module type the following:
+
+ perl Makefile.PL
+ make
+ make test
+ make install
+
+COPYRIGHT AND LICENCE
+
+Copyright (c) 1999,2000 Enno Derksen
+All rights reserved.
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
Added: branches/upstream/libxml-handler-printevents-perl/current/test.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libxml-handler-printevents-perl/current/test.pl?rev=10491&op=file
==============================================================================
--- branches/upstream/libxml-handler-printevents-perl/current/test.pl (added)
+++ branches/upstream/libxml-handler-printevents-perl/current/test.pl Sat Dec 1 12:31:20 2007
@@ -1,0 +1,17 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+#########################
+
+# change 'tests => 1' to 'tests => last_test_to_print';
+
+use Test;
+BEGIN { plan tests => 1 };
+use XML::Handler::PrintEvents;
+ok(1); # If we made it this far, we're ok.
+
+#########################
+
+# Insert your test code below, the Test module is use()ed here so read
+# its man page ( perldoc Test ) for help writing this test script.
+
More information about the Pkg-perl-cvs-commits
mailing list