parse the document before using XPath against it, doh!
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 3 Mar 2009 00:50:11 +0000 (00:50 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 3 Mar 2009 00:50:11 +0000 (00:50 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12361 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/extras/import/marc2bre.pl
Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm

index 76fa5bd..2a9645a 100755 (executable)
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use lib '/openils/lib/perl5/';
+#use lib '/openils/lib/perl5/';
 
 use Error qw/:try/;
 use OpenILS::Utils::Fieldmapper;
@@ -162,6 +162,7 @@ my $count = 0;
 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)
index 9e5a84e..0470cd5 100644 (file)
@@ -1091,7 +1091,8 @@ sub _extract_856_uris {
        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');