From: miker Date: Tue, 3 Mar 2009 00:50:11 +0000 (+0000) Subject: parse the document before using XPath against it, doh! X-Git-Tag: sprint4-merge-nov22~10659 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a5ff9e2833d2c8a708a6aee72d8c98db8807704c;p=working%2FEvergreen.git parse the document before using XPath against it, doh! git-svn-id: svn://svn.open-ils.org/ILS/trunk@12361 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/extras/import/marc2bre.pl b/Open-ILS/src/extras/import/marc2bre.pl index 76fa5bdb06..2a9645aae2 100755 --- a/Open-ILS/src/extras/import/marc2bre.pl +++ b/Open-ILS/src/extras/import/marc2bre.pl @@ -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) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm b/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm index 9e5a84e23d..0470cd5996 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm @@ -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');