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

XML parse errors parsing metadata payload #35

Open
sdm7g opened this issue Jan 28, 2019 · 1 comment
Open

XML parse errors parsing metadata payload #35

sdm7g opened this issue Jan 28, 2019 · 1 comment

Comments

@sdm7g
Copy link

sdm7g commented Jan 28, 2019

I'm using oaipmh via oai-harvest.
When the program hits an exception from a parse error in the metadata payload, it quits and stops harvesting. ( Typically not a problem with simple oai_dc metadata, but oai_ead has a lot more to get correct, and I'm seeing this frequently on several ArchivesSpace OAI feeds. )
I have found that back patching the Client.parse method to create an XMLParser with recover=True manages to finish harvesting the entire feed.
etree.XML(xml, etree.XMLParser(recover=True))

You might consider adding that as an option on creating Client, or as a subclass.

@sdm7g
Copy link
Author

sdm7g commented Apr 17, 2019

Withdrew #38 and reimplemented improved version #39
minimal changes. Default behavior is the same as before. Adds optional recover=True|False arg.
I discovered lxml.etree has it's own code to manage how errors are logged, so additional error logging code was unnecessary.

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

Successfully merging a pull request may close this issue.

1 participant