[open-ils-commits] r10589 -
trunk/Open-ILS/src/perlmods/OpenILS/Utils
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Sep 13 16:01:36 EDT 2008
Author: dbs
Date: 2008-09-13 16:01:32 -0400 (Sat, 13 Sep 2008)
New Revision: 10589
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm
Log:
Union approach to URL attributes was bug-ridden if a given attribute was not defined;
move to explicitly set attributes instead
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm 2008-09-13 07:27:57 UTC (rev 10588)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm 2008-09-13 20:01:32 UTC (rev 10589)
@@ -25,7 +25,7 @@
my $edition_xpath = "//mods:mods/mods:originInfo//mods:edition[1]";
my $abstract_xpath = "//mods:mods/mods:abstract";
my $related_xpath = "";
-my $online_loc_xpath = "(//mods:location/mods:url|//mods:location/mods:url/\@displayLabel|//mods:location/mods:url/\@note)";
+my $online_loc_xpath = "//mods:location/mods:url";
my $physical_desc = "(//mods:physicalDescription/mods:form|//mods:physicalDescription/mods:extent|".
"//mods:physicalDescription/mods:reformattingQuality|//mods:physicalDescription/mods:internetMediaType|".
"//mods:physicalDescription/mods:digitalOrigin)";
@@ -355,8 +355,11 @@
# ------------------------------
# holds an array of [ link, title, link, title, ... ]
$self->{master_doc}->{online_loc} = [];
- push(@{$self->{master_doc}->{online_loc}},
- $self->get_field_value( $mods, $online_loc_xpath ));
+ for my $url ($mods->findnodes($online_loc_xpath)) {
+ push(@{$self->{master_doc}->{online_loc}}, $url->textContent);
+ push(@{$self->{master_doc}->{online_loc}}, $url->getAttribute('displayLabel') || '');
+ push(@{$self->{master_doc}->{online_loc}}, $url->getAttribute('note') || '');
+ }
($self->{master_doc}->{synopsis}) =
$self->get_field_value( $mods, $abstract_xpath );
More information about the open-ils-commits
mailing list