fwiw, my proposed solution was to use MARC::File::XML from the
marc-xml cpan module [1]
use Net::OAI::Harvester;
use MARC::File::SAX;
my $url = 'http://memory.loc.gov/cgi-bin/oai2_0';
my $harvester = Net::OAI::Harvester->new(baseURL => $url);
my $response = $harvester->listRecords(metadataPrefix => 'marc21',
metadataHandler => 'MARC::File::SAX');
while ($record = $response->next()) {
# get the oai-pmh record as a MARC::Record object and print it out
print $record->metadata()->record()->as_formatted();
}
Note, this required some small adjustments to MARC::File::SAX. So
you'd need the latest version from CVS [2], which will go out to CPAN
some time I guess :-)
//Ed
[1] http://search.cpan.org/dist/MARC-XML/
[2] http://sourceforge.net/cvs/?group_id=1254
|