From: Remington Steed Date: Tue, 24 Feb 2015 18:25:16 +0000 (-0500) Subject: LP#957466: Fix invalid MARCXML syntax X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fefcdd1e3bdb4d0f9e7e5b1b62fec741c8960762;p=contrib%2FConifer.git LP#957466: Fix invalid MARCXML syntax This commit fixes some invalid MARCXML syntax, and also makes the XPath query more general to allow for namespaces on the tags. Signed-off-by: Remington Steed Signed-off-by: Dan Wells --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm index ff018d0257..66ab824a7d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm @@ -2139,10 +2139,10 @@ sub set_marc_905u { my ($class, $marcdoc, $username) = @_; # Look for existing 905$u subfields. If any exist, do nothing. - my @nodes = $marcdoc->findnodes('//field[@tag="905"]/subfield[@code="u"]'); + my @nodes = $marcdoc->findnodes('//*[@tag="905"]/*[@code="u"]'); unless (@nodes) { # We create a new 905 and the subfield u to that. - my $parentNode = $marcdoc->createElement('field'); + my $parentNode = $marcdoc->createElement('datafield'); $parentNode->setAttribute('tag', '905'); $parentNode->setAttribute('ind1', ''); $parentNode->setAttribute('ind2', '');