use strict;
use warnings;
-use lib '/openils/lib/perl5/';
+#use lib '/openils/lib/perl5/';
use Error qw/:try/;
use OpenILS::Utils::Fieldmapper;
PROCESS: while ( try { $rec = $batch->next } otherwise { $rec = -1 } ) {
next if ($rec == -1);
+ warn $rec->as_formatted;
$count++;
# Skip records that don't contain a required field (like '245', for example)
my $marcxml = shift;
my @objects;
- my @nodes = $marcxml->findnodes('//*[local-name()="datafield" and @tag="856" and (@ind1="4" or @ind1="1") and (@ind2="0" or @ind2="1")]');
+ my $document = $parser->parse_string($marcxml);
+ my @nodes = $document->findnodes('//*[local-name()="datafield" and @tag="856" and (@ind1="4" or @ind1="1") and (@ind2="0" or @ind2="1")]');
my $cstore = OpenSRF::AppSession->connect('open-ils.cstore');