[open-ils-commits] r12361 - in trunk/Open-ILS/src: extras/import perlmods/OpenILS/Application (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Mar 2 19:50:12 EST 2009


Author: miker
Date: 2009-03-02 19:50:11 -0500 (Mon, 02 Mar 2009)
New Revision: 12361

Modified:
   trunk/Open-ILS/src/extras/import/marc2bre.pl
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
Log:
parse the document before using XPath against it, doh!

Modified: trunk/Open-ILS/src/extras/import/marc2bre.pl
===================================================================
--- trunk/Open-ILS/src/extras/import/marc2bre.pl	2009-03-02 22:45:01 UTC (rev 12360)
+++ trunk/Open-ILS/src/extras/import/marc2bre.pl	2009-03-03 00:50:11 UTC (rev 12361)
@@ -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 @@
 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)

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm	2009-03-02 22:45:01 UTC (rev 12360)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm	2009-03-03 00:50:11 UTC (rev 12361)
@@ -1091,7 +1091,8 @@
 	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');
 



More information about the open-ils-commits mailing list