MARC21slim2MADS.xsl error processing 755 source

Bug #1800871 reported by Josh Stompro
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
3.6
Won't Fix
Undecided
Unassigned
3.8
Fix Released
Medium
Unassigned

Bug Description

EG Version: 3.0

The MARC21slim2MADS.xsl definition seems to have a bug that doesn't allow 755 field data to be processed when a source is specified.

The error is "runtime error: file ./MARC21slim2MADS.xsl line 1404 element attribute
xsl:attribute: Cannot add attributes to an element if children have been already added to the element."

See the discussion on the listserv at:
https://georgialibraries.markmail.org/thread/rmwcxkwjzv2qczmu

It looks like the issue may be that the setAuthority template is being called before the genre template, and that the genre template also calls the setAuthority template.

Removing the setAuthority template call from the 755 tag processing section seems to fix the issue.

If this is the issue then it needs to be fixed locally in Evergreen by updating the MARC21slim2MADS.xsl file, along with the copy that resides in the database.

It should also be reported upstream to the MODS listserve.

Using MADS to process authorities was introduced in version 3.0, so it may need to be backported that far.. although it isn't a security issue, so that may not be allowed. This can cause a roadblock when sites upgrade by causing the authority reingest in the 3.0 upgrade scripts to fail.

Linda Jansova provided an example of an authority that was hitting the error in her initial email about the problem.

Josh

Revision history for this message
Linda Jansova (skolkova-s) wrote :

The official file from the LC has already been updated accordingly:

-------- Forwarded Message --------
Subject: Re: [MODS] MARCXML to MADS XSLT - 2.15 revision
Date: Tue, 13 Nov 2018 21:49:04 +0000
From: Meehleib, Tracy <email address hidden>
Reply-To: Metadata Object Description Schema List <email address hidden>
To: <email address hidden>

Hi Linda,

The MARCXML to MADS XSLT has been updated and uploaded. Please let me know if you have any other issues with it. Apologies for the slow turnaround--we had server/network issues here at LC last week.

< http://www.loc.gov/standards/marcxml/xslt/MARC21slim2MADS.xsl>

Best, Tracy

Tracy Meehleib
Network Development and MARC Standards Office
Library of Congress
101 Independence Ave SE
Washington, DC 20540-4402
+1 202 707 0121 (voice)
+1 202 707 0115 (fax)
<email address hidden>

Changed in evergreen:
assignee: nobody → Josh Stompro (u-launchpad-stompro-org)
status: New → In Progress
tags: added: authority
Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Hello, I've taken a stab at updating the evergreen files related to this.

It is a pretty simple change, only 2 lines, one changelog line, and then moving two lines around.

Branch at user/stompro/lp1800871_MADS_2.15_update

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/stompro/lp1800871_MADS_2.15_update

Josh

tags: added: pullrequest
Changed in evergreen:
assignee: Josh Stompro (u-launchpad-stompro-org) → nobody
status: In Progress → Confirmed
Revision history for this message
Linda Jansova (skolkova-s) wrote :

Thank you, Josh!

Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbej)
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks, Josh and Linda, for figuring out such a gnarly issue, and for getting it fixed upstream!

One concern with the upgrade script: shouldn't it be an UPDATE config.xml_transform SET... WHERE ... statement instead of an INSERT? I get the following error when I try to run it:

ERROR: duplicate key value violates unique constraint "xml_transform_pkey"
DETAIL: Key (name)=(mads21) already exists.

Also, to simplify testing, in which log can I find that error message?

Changed in evergreen:
assignee: Jane Sandberg (sandbej) → nobody
Revision history for this message
Linda Jansova (skolkova-s) wrote :

It looks likely to me but it will surely be up to Josh to confirm it...

Thank you, Jane, for testing the upgrade script! It will be great to have the right file on the server without having to make the changes manually :-)!

Michele Morgan (mmorgan)
Changed in evergreen:
milestone: none → 3.3.4
Changed in evergreen:
milestone: 3.3.4 → 3.3.5
Changed in evergreen:
milestone: 3.3.5 → 3.4.2
Changed in evergreen:
milestone: 3.4.2 → 3.4.3
Changed in evergreen:
milestone: 3.4.3 → 3.4.4
Changed in evergreen:
milestone: 3.4.4 → 3.5.1
Changed in evergreen:
milestone: 3.5.1 → 3.5.2
Changed in evergreen:
milestone: 3.5.2 → 3.6.1
Changed in evergreen:
milestone: 3.6.1 → 3.6.2
Revision history for this message
Jane Sandberg (sandbergja) wrote :

I took the opportunity to rebase, sign off on Josh's commit, and add a follow-up commit to change the upgrade script to an UPDATE rather than INSERT statement: user/sandbergja/lp1800871_MADS_2.15_update

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Jane, thanks for reviving this, sorry I didn't see your earlier message about the update using an insert. I think I must have been copying the update script that added the feature and didn't think about the fact that it was already there for upgrades. I agree that it should be an update.
Josh

Revision history for this message
Jane Sandberg (sandbergja) wrote :

Some testing notes:

1) To recreate the error, you can
  a) take the marcxml from Linda's original email (https://markmail.org/thread/2ay3j4wg7fecymhz)
  b) Using psql, try to INSERT INTO authority.record_entry (marc, last_xact_id) VALUES ($$the_contents_of_the_xml_file$$, 'testing);

2) Then you can try to run the upgrade script. Keep in mind that there are some special unicode characters in the stylesheet, so just copy/pasting it into psql, say, may fail depending on character settings in your terminal, server, etc. Much better to run:

psql < XXXX.data.MADS21-xsl.sql

3) And then try step 1 again and make sure it can be successfully indexed.

4) Also, try building a server with this branch to make sure it builds successfully, and that the authority record can be INSERTed properly.

Changed in evergreen:
milestone: 3.6.2 → 3.6.3
Changed in evergreen:
milestone: 3.6.3 → 3.6.4
Changed in evergreen:
milestone: 3.6.4 → 3.7.2
Revision history for this message
Jason Boyer (jboyer) wrote :

I checked this out and it looks good to me. Signoff is here: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/jboyer/lp1800871_mads_signoff / working/user/jboyer/lp1800871_mads_signoff

tags: added: signedoff
Beth Willis (willis-a)
tags: added: cat-authority
removed: authority
no longer affects: evergreen/3.1
no longer affects: evergreen/3.2
no longer affects: evergreen/3.3
no longer affects: evergreen/3.4
no longer affects: evergreen/3.5
Changed in evergreen:
milestone: 3.7.2 → 3.7.3
Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbergja)
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Pushed to 3.7 and above. Thanks so much, Josh, Linda, and Jason.

Changed in evergreen:
assignee: Jane Sandberg (sandbergja) → nobody
status: Confirmed → Fix Committed
importance: Undecided → Medium
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.