| 1 | package Catmandu::Importer::SRU::Parser::rawscip-perl cpan Catmandu-SRU 0.430 Catmandu/Importer/SRU/Parser/raw/; |
| 2 | |
| 3 | use Mooscip-perl cpan Catmandu-SRU 0.430 Moo/; |
| 4 | |
| 5 | our $VERSIONscip-perl cpan Catmandu-SRU 0.430 Catmandu/Importer/SRU/Parser/raw/$VERSION. = '0.430'; |
| 6 | |
| 7 | sub parsescip-perl cpan Catmandu-SRU 0.430 Catmandu/Importer/SRU/Parser/raw/parse(). { |
| 8 | my ($self, $record) = @_scip-perl cpan Catmandu-SRU 0.430 Catmandu/Importer/SRU/Parser/raw/`@_`.; |
| 9 | |
| 10 | my $xml = $record->{recordData}->toStringscip-perl cpan Catmandu-SRU 0.430 Catmandu/Importer/SRU/Parser/raw/toString().; |
| 11 | $record->{recordData} = $xml; |
| 12 | |
| 13 | return $record; |
| 14 | } |
| 15 | |
| 16 | 1; |
| 17 | __END__ |
| 18 | |
| 19 | =head1 NAME |
| 20 | |
| 21 | Catmandu::Importer::SRU::Parser::raw - Package transforms SRU responses into a Perl hash |
| 22 | |
| 23 | =head1 SYNOPSIS |
| 24 | |
| 25 | my $importer = Catmandu::Importer::SRU->new( |
| 26 | base => 'http://www.unicat.be/sru', |
| 27 | query => '(isbn=0855275103 or isbn=3110035170 or isbn=9010017362 or isbn=9014026188)', |
| 28 | recordSchema => 'marcxml', |
| 29 | parser => 'raw', |
| 30 | ); |
| 31 | |
| 32 | =head1 DESCRIPTION |
| 33 | |
| 34 | Transforms each SRU record into a Perl hash containing the following fields: |
| 35 | |
| 36 | =over |
| 37 | |
| 38 | =item recordSchema |
| 39 | |
| 40 | the L<SRU record schema|http://www.loc.gov/standards/sru/recordSchemas/> |
| 41 | |
| 42 | =item recordPacking |
| 43 | |
| 44 | the SRU format (can be 'string' or 'xml') |
| 45 | |
| 46 | =item recordPosition |
| 47 | |
| 48 | the result number |
| 49 | |
| 50 | =item recordData |
| 51 | |
| 52 | the unparsed record payload |
| 53 | |
| 54 | =back |
| 55 | |
| 56 | =head1 SEE ALSO |
| 57 | |
| 58 | L<Catmandu::Importer::SRU::Parser::meta> |
| 59 | |
| 60 | =head1 AUTHOR |
| 61 | |
| 62 | Patrick Hochstenbach, C<< <patrick.hochstenbach at ugent.be> >> |
| 63 | |
| 64 | =cut |