line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::OAI::SAX::Text; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
@ISA = qw( XML::SAX::Base ); |
4
|
|
|
|
|
|
|
|
5
|
11
|
|
|
11
|
|
68
|
use strict; |
|
11
|
|
|
|
|
17
|
|
|
11
|
|
|
|
|
2513
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '4.12'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub start_element |
10
|
|
|
|
|
|
|
{ |
11
|
493
|
|
|
493
|
1
|
11605
|
( my $self, my $hash, @_ ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
493
|
|
|
|
|
720
|
$self->{Data} = ""; |
14
|
493
|
|
|
|
|
559
|
push @{$self->{Attributes}}, $hash->{Attributes}; |
|
493
|
|
|
|
|
862
|
|
15
|
|
|
|
|
|
|
|
16
|
493
|
|
|
|
|
1069
|
$self->SUPER::start_element( $hash, @_ ); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
772
|
|
|
772
|
1
|
11351
|
sub characters { $_[0]->{Data} .= $_[1]->{Data} } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub end_element |
22
|
|
|
|
|
|
|
{ |
23
|
484
|
|
|
484
|
1
|
2701
|
( my $self, my $hash, @_ ) = @_; |
24
|
|
|
|
|
|
|
|
25
|
484
|
|
|
|
|
769
|
$hash->{Text} = $self->{Data}; |
26
|
484
|
50
|
|
|
|
519
|
$hash->{Attributes} = pop @{$self->{Attributes} || []}; |
|
484
|
|
|
|
|
1056
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# strip surrounding whitespace in leaf nodes |
29
|
484
|
|
|
|
|
1318
|
$hash->{Text} =~ s/^\s+//; |
30
|
484
|
|
|
|
|
1290
|
$hash->{Text} =~ s/\s+$//; |
31
|
|
|
|
|
|
|
|
32
|
484
|
|
|
|
|
1580
|
$self->SUPER::characters( {Data => $self->{Data}}, @_ ); |
33
|
|
|
|
|
|
|
|
34
|
484
|
|
|
|
|
6017
|
$self->{Data} = ""; |
35
|
|
|
|
|
|
|
|
36
|
484
|
|
|
|
|
979
|
$self->SUPER::end_element( $hash, @_ ); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 NAME |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
HTTP::OAI::SAX::Text |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 DESCRIPTION |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
This module adds Text and Attributes to the end_element call. This is only useful for leaf nodes (elements that don't contain any child elements). |