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
|
|
76
|
use strict; |
|
11
|
|
|
|
|
48
|
|
|
11
|
|
|
|
|
3030
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '4.13'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub start_element |
10
|
|
|
|
|
|
|
{ |
11
|
493
|
|
|
493
|
1
|
13985
|
( my $self, my $hash, @_ ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
493
|
|
|
|
|
846
|
$self->{Data} = ""; |
14
|
493
|
|
|
|
|
641
|
push @{$self->{Attributes}}, $hash->{Attributes}; |
|
493
|
|
|
|
|
1129
|
|
15
|
|
|
|
|
|
|
|
16
|
493
|
|
|
|
|
1310
|
$self->SUPER::start_element( $hash, @_ ); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
772
|
|
|
772
|
1
|
14132
|
sub characters { $_[0]->{Data} .= $_[1]->{Data} } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub end_element |
22
|
|
|
|
|
|
|
{ |
23
|
484
|
|
|
484
|
1
|
3249
|
( my $self, my $hash, @_ ) = @_; |
24
|
|
|
|
|
|
|
|
25
|
484
|
|
|
|
|
907
|
$hash->{Text} = $self->{Data}; |
26
|
484
|
50
|
|
|
|
608
|
$hash->{Attributes} = pop @{$self->{Attributes} || []}; |
|
484
|
|
|
|
|
1312
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# strip surrounding whitespace in leaf nodes |
29
|
484
|
|
|
|
|
1596
|
$hash->{Text} =~ s/^\s+//; |
30
|
484
|
|
|
|
|
1562
|
$hash->{Text} =~ s/\s+$//; |
31
|
|
|
|
|
|
|
|
32
|
484
|
|
|
|
|
1978
|
$self->SUPER::characters( {Data => $self->{Data}}, @_ ); |
33
|
|
|
|
|
|
|
|
34
|
484
|
|
|
|
|
7290
|
$self->{Data} = ""; |
35
|
|
|
|
|
|
|
|
36
|
484
|
|
|
|
|
1181
|
$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). |