Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XSLT error when running v2.0.0 #224

Closed
RichardWallis opened this issue Sep 6, 2022 · 6 comments
Closed

XSLT error when running v2.0.0 #224

RichardWallis opened this issue Sep 6, 2022 · 6 comments

Comments

@RichardWallis
Copy link

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
Copy link

jimfhahn commented Sep 6, 2022

@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
Copy link
Contributor

ntra00 commented Sep 6, 2022

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
Copy link
Author

Thanks for the headsup @ntra00.

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

@kefo
Copy link
Member

kefo commented Sep 8, 2022

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
Copy link
Author

@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
Copy link
Member

kefo commented Sep 9, 2022

Fixed with 0ee9a74

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

@kefo kefo closed this as completed Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants