| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package HTTP::OAI::Metadata::METS; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
508
|
use XML::LibXML; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
10
|
|
|
4
|
1
|
|
|
1
|
|
185
|
use XML::LibXML::XPathContext; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
45
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
@ISA = qw( HTTP::OAI::Metadata ); |
|
7
|
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
6
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
323
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '4.13'; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
|
13
|
1
|
|
|
1
|
0
|
2
|
my $class = shift; |
|
14
|
1
|
|
|
|
|
9
|
my $self = $class->SUPER::new(@_); |
|
15
|
1
|
|
|
|
|
3
|
my %args = @_; |
|
16
|
1
|
|
|
|
|
6
|
$self; |
|
17
|
|
|
|
|
|
|
} |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _xc |
|
20
|
|
|
|
|
|
|
{ |
|
21
|
5
|
|
|
5
|
|
162
|
my $xc = XML::LibXML::XPathContext->new( @_ ); |
|
22
|
5
|
|
|
|
|
37
|
$xc->registerNs( 'oai_dc', HTTP::OAI::OAI_NS ); |
|
23
|
5
|
|
|
|
|
16
|
$xc->registerNs( 'mets', 'http://www.loc.gov/METS/' ); |
|
24
|
5
|
|
|
|
|
13
|
$xc->registerNs( 'xlink', 'http://www.w3.org/1999/xlink' ); |
|
25
|
5
|
|
|
|
|
10
|
return $xc; |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub files |
|
29
|
|
|
|
|
|
|
{ |
|
30
|
1
|
|
|
1
|
0
|
12
|
my $self = shift; |
|
31
|
1
|
|
|
|
|
6
|
my $dom = $self->dom; |
|
32
|
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
11
|
my $xc = _xc($dom); |
|
34
|
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
2
|
my @files; |
|
36
|
1
|
|
|
|
|
4
|
foreach my $file ($xc->findnodes( '*//mets:file' )) |
|
37
|
|
|
|
|
|
|
{ |
|
38
|
4
|
|
|
|
|
128
|
my $f = {}; |
|
39
|
4
|
|
|
|
|
13
|
foreach my $attr ($file->attributes) |
|
40
|
|
|
|
|
|
|
{ |
|
41
|
28
|
|
|
|
|
166
|
$f->{ $attr->nodeName } = $attr->nodeValue; |
|
42
|
|
|
|
|
|
|
} |
|
43
|
4
|
|
|
|
|
28
|
$file = _xc($file); |
|
44
|
4
|
|
|
|
|
13
|
foreach my $locat ($file->findnodes( 'mets:FLocat' )) |
|
45
|
|
|
|
|
|
|
{ |
|
46
|
4
|
|
|
|
|
147
|
$f->{ url } = $locat->getAttribute( 'xlink:href' ); |
|
47
|
|
|
|
|
|
|
} |
|
48
|
4
|
|
|
|
|
60
|
push @files, $f; |
|
49
|
|
|
|
|
|
|
} |
|
50
|
|
|
|
|
|
|
|
|
51
|
1
|
|
|
|
|
16
|
return @files; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |