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

MARC::XMLWriter will generate invalid XML documents. #882

Open
corylown opened this issue Jun 17, 2022 · 2 comments
Open

MARC::XMLWriter will generate invalid XML documents. #882

corylown opened this issue Jun 17, 2022 · 2 comments

Comments

@corylown
Copy link
Member

MARC::XMLWriter is used by MarcRecordWriterService and OaiMarcRecordWriterService to generate MARC XML documents from contributor supplied MARC records. The supplied MARC records can include invalid byte sequences, non-printing control characters, and other anomalies that are invalid in XML.

This ticket is a placeholder for determining what, if anything, we ought to do about this.

Interestingly, because we're using Nokogiri to produce OAI-PMH responses from documents containing XML record snippets, the OAI feed is valid XML because Nokogiri appears to remove data that would be invalid in XML. However, MARC XML formatted normalized full dumps and deltas served via the web app and ResourceSync may be invalid.

@JohnMarkOckerbloom
Copy link

Do we know how Nokogiri handles the invalid data? (Do they just remove invalid characters, or do they do something more than that?) Might not hurt for us to do the same thing when normalizing, if that's easily done; it'd be a straightforward way to bring the different MARC XML views into sync.

@corylown
Copy link
Member Author

In the case I observed Nokogiri removed the invalid bytes.

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