MARC21slim2MADS.xsl error processing 755 source

Bug #1800871 reported by Josh Stompro on 2018-10-31
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Undecided
Unassigned
3.1
Undecided
Unassigned
3.2
Undecided
Unassigned
3.3
Undecided
Unassigned
3.4
Undecided
Unassigned
3.5
Undecided
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!

Jane Sandberg (sandbej) on 2019-08-01
Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbej)
Revision history for this message
Jane Sandberg (sandbej) 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) on 2019-08-26
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 (sandbej) 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 (sandbej) 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
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers