line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MARC::Moose::Parser::MarcxmlSax; |
2
|
|
|
|
|
|
|
# ABSTRACT: Parser for MARXML records using SAX parser |
3
|
|
|
|
|
|
|
$MARC::Moose::Parser::MarcxmlSax::VERSION = '1.0.44'; |
4
|
4
|
|
|
4
|
|
30
|
use Moose; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
28
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
extends 'MARC::Moose::Parser'; |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
25795
|
use MARC::Moose::Field::Control; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
97
|
|
9
|
4
|
|
|
4
|
|
22
|
use MARC::Moose::Field::Std; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
123
|
|
10
|
4
|
|
|
4
|
|
2270
|
use MARC::Moose::Parser::MarcxmlSaxHandler; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
178
|
|
11
|
4
|
|
|
4
|
|
26
|
use XML::SAX qw(Namespaces Validation);; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
476
|
|
12
|
4
|
|
|
4
|
|
28
|
use YAML; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
810
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has parser => ( |
16
|
|
|
|
|
|
|
is => 'rw', |
17
|
|
|
|
|
|
|
default => sub { |
18
|
|
|
|
|
|
|
my $self = shift; |
19
|
|
|
|
|
|
|
my $factory = XML::SAX::ParserFactory->new(); |
20
|
|
|
|
|
|
|
my $parser = $factory->parser( |
21
|
|
|
|
|
|
|
Handler => MARC::Moose::Parser::MarcxmlSaxHandler->new(), |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
$self->parser( $parser ); |
24
|
|
|
|
|
|
|
}, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
override 'parse' => sub { |
29
|
|
|
|
|
|
|
my ($self, $raw) = @_; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
return unless $raw; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
$self->parser->parse_string( $raw ); |
34
|
|
|
|
|
|
|
my $record = $self->parser->{Handler}->{record}; |
35
|
|
|
|
|
|
|
return $record; |
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=pod |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=encoding UTF-8 |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 NAME |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
MARC::Moose::Parser::MarcxmlSax - Parser for MARXML records using SAX parser |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 VERSION |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
version 1.0.44 |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 DESCRIPTION |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Parser for MARCXML records using SAX parser. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 SEE ALSO |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=over 4 |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=item * |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
L<MARC::Moose> |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=item * |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
L<MARC::Moose::Parser> |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=item * |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
L<MARC::Moose::Parser::Marcxml> |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=back |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 AUTHOR |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Frédéric Demians <f.demians@tamil.fr> |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
This software is copyright (c) 2021 by Frédéric Demians. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
87
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=cut |