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

Add a basic validation on field lengths in fixed length fields #83

Open
phochste opened this issue Oct 10, 2017 · 3 comments
Open

Add a basic validation on field lengths in fixed length fields #83

phochste opened this issue Oct 10, 2017 · 3 comments

Comments

@phochste
Copy link
Member

Errors in the field length of the leader will crash the Catmandu::Exporter::MARC::ISO with an
error message

This Oops! substr outside of string at
/usr/local/share/perl/5.22.1/MARC/Record.pm line 573, <GEN0> line 30.

There could be a more informative message given.

@phochste
Copy link
Member Author

Also other errors in the leader will generate illegal ISO ouput. E.g. leader ^^^^^nam^^22^^^^^^a^^4500 (too many positions before nam)

@CaptSolo
Copy link

We are getting this error when converting data from MARC/XML to ISO MARC.

Is there a way to make Catmandu ignore the records with errors and continue processing other records?

@phochste
Copy link
Member Author

In Catmandu we are very dependent on the capabilities of the underlying parser. For, MARC/XML skipping of records needs to be supported by MARC::File::XML, which is by itself dependent on XML::LibXML. As far as I know, XML parsers can't skip XML with syntax errors. These errors can't be recovered.

I don't know if MARC::File::XML supports skipping records that are syntactically valid XML, but not valid MARC/XML.

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

2 participants