line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::OAI::ListMetadataFormats; |
2
|
|
|
|
|
|
|
|
3
|
14
|
|
|
14
|
|
74
|
use strict; |
|
14
|
|
|
|
|
51
|
|
|
14
|
|
|
|
|
565
|
|
4
|
14
|
|
|
14
|
|
68
|
use base qw( XML::SAX::Base ); |
|
14
|
|
|
|
|
90
|
|
|
14
|
|
|
|
|
1050
|
|
5
|
14
|
|
|
14
|
|
72
|
use base qw( Net::OAI::Base ); |
|
14
|
|
|
|
|
25
|
|
|
14
|
|
|
|
|
25105234
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Net::OAI::ListMetadataFormats - Results of the ListMetadataFormats OAI-PMH verb. |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SYNOPSIS |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 DESCRIPTION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 METHODS |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head2 new() |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
2
|
|
|
2
|
1
|
12
|
my ( $class, %opts ) = @_; |
23
|
2
|
|
33
|
|
|
27
|
my $self = bless \%opts, ref( $class ) || $class; |
24
|
2
|
|
|
|
|
20
|
$self->{ insideList } = 0; |
25
|
2
|
|
|
|
|
8
|
$self->{ metadataPrefixes } = []; |
26
|
2
|
|
|
|
|
7
|
$self->{ namespaces } = []; |
27
|
2
|
|
|
|
|
9
|
$self->{ schemas } = []; |
28
|
2
|
|
|
|
|
9
|
return( $self ); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head2 prefixes() |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=cut |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub prefixes() { |
36
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
37
|
1
|
|
|
|
|
2
|
return( @{ $self->{ metadataPrefixes } } ); |
|
1
|
|
|
|
|
8
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head2 namespaces() |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub namespaces { |
45
|
1
|
|
|
1
|
1
|
1209
|
my $self = shift; |
46
|
1
|
|
|
|
|
3
|
return( @{ $self->{ namespaces } } ); |
|
1
|
|
|
|
|
8
|
|
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 namespaces_byprefix() |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Returns the namespace URI associated to a given metadataPrefix. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub namespaces_byprefix { |
56
|
1
|
|
|
1
|
1
|
657
|
my ($self, $prefix) = @_; |
57
|
1
|
|
|
|
|
7
|
return $self->{namespaces_byprefix}->{$prefix}; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 schemas() |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub schemas { |
66
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
67
|
1
|
|
|
|
|
2
|
return( @{ $self->{ schemas } } ); |
|
1
|
|
|
|
|
44
|
|
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 schemas_byprefix() |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Returns the schema URI associated to a given metadataPrefix. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub schemas_byprefix { |
77
|
1
|
|
|
1
|
1
|
494
|
my ($self, $prefix) = @_; |
78
|
1
|
|
|
|
|
9
|
return $self->{schemas_byprefix}->{$prefix}; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
## SAX Handlers |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub start_element { |
85
|
23
|
|
|
23
|
1
|
177
|
my ( $self, $element ) = @_; |
86
|
23
|
100
|
|
|
|
55
|
if ( $element->{ Name } eq 'ListMetadataFormats' ) { |
87
|
1
|
|
|
|
|
3
|
$self->{ insideList } = 1; |
88
|
|
|
|
|
|
|
} else { |
89
|
22
|
|
|
|
|
78
|
$self->SUPER::start_element( $element ); |
90
|
|
|
|
|
|
|
} |
91
|
23
|
|
|
|
|
162
|
push( @{ $self->{ tagStack } }, $element->{ Name } ); |
|
23
|
|
|
|
|
128
|
|
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub end_element { |
95
|
23
|
|
|
23
|
1
|
159
|
my ( $self, $element ) = @_; |
96
|
23
|
|
|
|
|
38
|
my $name = $element->{ Name }; |
97
|
23
|
100
|
|
|
|
96
|
if ( $name eq 'ListMetadataFormats' ) { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
98
|
1
|
|
|
|
|
4
|
$self->{ insideList } = 0; |
99
|
|
|
|
|
|
|
} elsif ( $name eq 'metadataFormat' ) { |
100
|
4
|
|
|
|
|
9
|
my $nspf = delete $self->{ _currpf }; |
101
|
4
|
|
|
|
|
17
|
$self->{ namespaces_byprefix }->{ $nspf } = delete $self->{ _currns }; |
102
|
4
|
|
|
|
|
27
|
$self->{ schemas_byprefix }->{ $nspf } = delete $self->{ _currxs }; |
103
|
|
|
|
|
|
|
} elsif ( $name eq 'metadataPrefix' ) { |
104
|
4
|
|
|
|
|
6
|
push( @{ $self->{ metadataPrefixes } }, $self->{ metadataPrefix } ); |
|
4
|
|
|
|
|
14
|
|
105
|
4
|
|
|
|
|
11
|
$self->{ _currpf } = $self->{ metadataPrefix }; |
106
|
4
|
|
|
|
|
9
|
$self->{ metadataPrefix } = ''; |
107
|
|
|
|
|
|
|
} elsif ( $name eq 'schema' ) { |
108
|
4
|
|
|
|
|
6
|
push( @{ $self->{ schemas } }, $self->{schema } ); |
|
4
|
|
|
|
|
14
|
|
109
|
4
|
|
|
|
|
9
|
$self->{ _currxs } = $self->{ schema }; |
110
|
4
|
|
|
|
|
8
|
$self->{ schema } = ''; |
111
|
|
|
|
|
|
|
} elsif ( $name eq 'metadataNamespace' ) { |
112
|
4
|
|
|
|
|
5
|
push( @{ $self->{ namespaces } }, $self->{ metadataNamespace } ); |
|
4
|
|
|
|
|
13
|
|
113
|
4
|
|
|
|
|
9
|
$self->{ _currns } = $self->{ metadataNamespace }; |
114
|
4
|
|
|
|
|
11
|
$self->{ metadataNamespace } = ''; |
115
|
|
|
|
|
|
|
} else { |
116
|
6
|
|
|
|
|
34
|
$self->SUPER::end_element( $element ); |
117
|
|
|
|
|
|
|
} |
118
|
23
|
|
|
|
|
83
|
pop( @{ $self->{ tagStack } } ); |
|
23
|
|
|
|
|
105
|
|
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub characters { |
122
|
45
|
|
|
45
|
1
|
333
|
my ( $self, $characters ) = @_; |
123
|
45
|
|
|
|
|
139
|
$self->SUPER::characters( $characters ); |
124
|
45
|
|
|
|
|
520
|
$self->{ $self->{ tagStack }[-1] } .= $characters->{ Data }; |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
1; |