line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::OAI::Metadata; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
@ISA = qw( HTTP::OAI::MemberMixin HTTP::OAI::SAX::Base ); |
4
|
|
|
|
|
|
|
|
5
|
11
|
|
|
11
|
|
69
|
use strict; |
|
11
|
|
|
|
|
20
|
|
|
11
|
|
|
|
|
4013
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '4.12'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
15
|
|
|
15
|
0
|
389
|
my( $class, %self ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
15
|
|
|
|
|
29
|
my $inst = bless \%self, $class; |
14
|
|
|
|
|
|
|
|
15
|
15
|
50
|
|
|
|
35
|
if ($self{dom}) { |
16
|
0
|
|
|
|
|
0
|
$inst->_elem("dom", $self{dom}); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
else { |
19
|
15
|
|
|
|
|
143
|
$inst->{doc} = XML::LibXML::Document->new( '1.0', 'UTF-8' ); |
20
|
15
|
|
|
|
|
142
|
$inst->{dom} = $inst->{current} = $inst->{doc}->createDocumentFragment; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
15
|
|
|
|
|
69
|
return $inst; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
0
|
0
|
0
|
sub metadata { shift->dom( @_ ) } |
27
|
4
|
|
|
4
|
1
|
21
|
sub dom { shift->_elem( "dom", @_ ) } |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub generate |
30
|
|
|
|
|
|
|
{ |
31
|
3
|
|
|
3
|
0
|
14
|
my( $self, $driver ) = @_; |
32
|
|
|
|
|
|
|
|
33
|
3
|
|
|
|
|
10
|
$driver->generate( $self->dom ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub start_element |
37
|
|
|
|
|
|
|
{ |
38
|
175
|
|
|
175
|
1
|
1179
|
my( $self, $hash ) = @_; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
my $node = $self->{doc}->createElementNS( |
41
|
|
|
|
|
|
|
$hash->{NamespaceURI}, |
42
|
|
|
|
|
|
|
$hash->{Name}, |
43
|
175
|
|
|
|
|
1009
|
); |
44
|
175
|
|
|
|
|
241
|
foreach my $attr (values %{$hash->{Attributes}}) |
|
175
|
|
|
|
|
427
|
|
45
|
|
|
|
|
|
|
{ |
46
|
119
|
50
|
|
|
|
1603
|
Carp::confess "Can't setAttribute without attribute name" if !defined $attr->{Name}; |
47
|
119
|
|
|
|
|
237
|
$node->setAttribute( $attr->{Name}, $attr->{Value} ); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
175
|
|
|
|
|
1574
|
$self->{current} = $self->{current}->appendChild( $node ); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub end_element |
54
|
|
|
|
|
|
|
{ |
55
|
175
|
|
|
175
|
1
|
1120
|
my( $self, $hash ) = @_; |
56
|
|
|
|
|
|
|
|
57
|
175
|
|
|
|
|
641
|
$self->{current} = $self->{current}->parentNode; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub characters |
61
|
|
|
|
|
|
|
{ |
62
|
175
|
|
|
175
|
1
|
3010
|
my( $self, $hash ) = @_; |
63
|
|
|
|
|
|
|
|
64
|
175
|
|
|
|
|
734
|
$self->{current}->appendText( $hash->{Data} ); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
__END__ |