lcnetdev / marc2bibframe2

Convert MARC records to BIBFRAME2 RDF
http://www.loc.gov/bibframe/
Creative Commons Zero v1.0 Universal
88 stars 35 forks source link

XSLT error when running v2.0.0 #224

Closed RichardWallis closed 1 year ago

RichardWallis commented 2 years ago

Tried upgrading my current setup to the latest 2.0.0 release and got the following error in my Python environment: Failed to evaluate the 'select' expression.

To see if the problem is in my code or in the released code I went back to basics:

wallisr$ xsltproc xsl/marc2bibframe2.xsl test/data/marc.xml
XPath error : Invalid type
runtime error: file xsl/ConvSpec-Process8-ProvAct.xsl line 420 element for-each
Failed to evaluate the 'select' expression.
no result for test/data/marc.xml

... which seems to indicate the problem is in marc2bibframe2

jimfhahn commented 2 years ago

@RichardWallis I had the same issue, and was able to work around this in python by consulting this question: https://stackoverflow.com/questions/29443364/use-saxon-with-python ... the error has to do with saxon in python and one approach is to call saxon as a subprocess

import subprocess

subprocess.call(["saxon", "-o:output.xml", "-s:marc.xml", "./xsl/marc2bibframe2.xsl"])

ntra00 commented 2 years ago

Thanks to both; we accidentally put in a 2.0 function in our 1.0 stylesheet. We're converting it to exsl:node-set and it should be fixed soon.

RichardWallis commented 2 years ago

Thanks for the headsup @ntra00.

Looking forward to the fix hoping it fits in with a looming deadline I have.

kefo commented 2 years ago

Can you grab a copy of the master branch and see if you can run 2.0 now, please? I've not tried it with xsltproc (and I'm out of time today), but I could replicate the issue with xalan and I have it running functioning with that processor.

If it looks good, we'll make a patch release.

RichardWallis commented 1 year ago

@kefo Ran the master branch successfully locally both using xsltproc (on Mac) and with our Python based code using the lxml library.

Looks good!

kefo commented 1 year ago

Fixed with https://github.com/lcnetdev/marc2bibframe2/commit/0ee9a74db68127c664efb789b7c6bc09097d3047

New release available: https://github.com/lcnetdev/marc2bibframe2/releases/tag/v2.0.2