File Coverage

blib/lib/XML/SAX/PurePerl/DebugHandler.pm
Criterion Covered Total %
statement 30 43 69.7
branch 8 24 33.3
condition n/a
subroutine 10 14 71.4
pod 0 13 0.0
total 48 94 51.0


line stmt bran cond sub pod time code
1             # $Id$
2              
3             package XML::SAX::PurePerl::DebugHandler;
4              
5 9     9   3459 use strict;
  9         18  
  9         4775  
6              
7             sub new {
8 7     7 0 92 my $class = shift;
9 7         21 my %opts = @_;
10 7         26 return bless \%opts, $class;
11             }
12              
13             # DocumentHandler
14              
15             sub set_document_locator {
16 14     14 0 291 my $self = shift;
17 14 50       52 print "set_document_locator\n" if $ENV{DEBUG_XML};
18 14         46 $self->{seen}{set_document_locator}++;
19             }
20              
21             sub start_document {
22 14     14 0 221 my $self = shift;
23 14 50       36 print "start_document\n" if $ENV{DEBUG_XML};
24 14         42 $self->{seen}{start_document}++;
25             }
26              
27             sub end_document {
28 11     11 0 218 my $self = shift;
29 11 50       46 print "end_document\n" if $ENV{DEBUG_XML};
30 11         303 $self->{seen}{end_document}++;
31             }
32              
33             sub start_element {
34 447     447 0 3645 my $self = shift;
35 447 50       912 print "start_element\n" if $ENV{DEBUG_XML};
36 447         848 $self->{seen}{start_element}++;
37             }
38              
39             sub end_element {
40 447     447 0 2926 my $self = shift;
41 447 50       791 print "end_element\n" if $ENV{DEBUG_XML};
42 447         825 $self->{seen}{end_element}++;
43             }
44              
45             sub characters {
46 994     994 0 6234 my $self = shift;
47 994 50       1614 print "characters\n" if $ENV{DEBUG_XML};
48             # warn "Char: ", $_[0]->{Data}, "\n";
49 994         1732 $self->{seen}{characters}++;
50             }
51              
52             sub processing_instruction {
53 4     4 0 43 my $self = shift;
54 4 50       8 print "processing_instruction\n" if $ENV{DEBUG_XML};
55 4         7 $self->{seen}{processing_instruction}++;
56             }
57              
58             sub ignorable_whitespace {
59 0     0 0 0 my $self = shift;
60 0 0       0 print "ignorable_whitespace\n" if $ENV{DEBUG_XML};
61 0         0 $self->{seen}{ignorable_whitespace}++;
62             }
63              
64             # LexHandler
65              
66             sub comment {
67 15     15 0 205 my $self = shift;
68 15 50       39 print "comment\n" if $ENV{DEBUG_XML};
69 15         41 $self->{seen}{comment}++;
70             }
71              
72             # DTDHandler
73              
74             sub notation_decl {
75 0     0 0   my $self = shift;
76 0 0         print "notation_decl\n" if $ENV{DEBUG_XML};
77 0           $self->{seen}{notation_decl}++;
78             }
79              
80             sub unparsed_entity_decl {
81 0     0 0   my $self = shift;
82 0 0         print "unparsed_entity_decl\n" if $ENV{DEBUG_XML};
83 0           $self->{seen}{entity_decl}++;
84             }
85              
86             # EntityResolver
87              
88             sub resolve_entity {
89 0     0 0   my $self = shift;
90 0 0         print "resolve_entity\n" if $ENV{DEBUG_XML};
91 0           $self->{seen}{resolve_entity}++;
92 0           return '';
93             }
94              
95             1;