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

fix: XML::Reader error handling during xmlTextReaderExpand #2714

Merged
merged 1 commit into from Dec 7, 2022

Conversation

flavorjones
Copy link
Member

@flavorjones flavorjones commented Dec 6, 2022

What problem is this PR intended to solve?

XML::Reader parsing errors encountered during Reader#attribute_hash and Reader#namespaces now raise an XML::SyntaxError.

Previously these methods would return nil and users would generally experience NoMethodErrors from elsewhere in the code.

Have you included adequate test coverage?

Test coverage added.

Does this change affect the behavior of either the C or the Java implementations?

The C and Java parsers differ in when they detect a syntax error in this case. libxml2 indicates an error when we try to expand a start tag that does not have a matching end tag, but xerces will defer the error until later. The tests reflect that difference.

@flavorjones flavorjones added this to the v1.14.0 milestone Dec 6, 2022
@flavorjones flavorjones force-pushed the flavorjones-fix-reader-error-handling_main branch from e0dcf1c to 549ac3a Compare December 6, 2022 18:58
@flavorjones flavorjones force-pushed the flavorjones-fix-reader-error-handling_main branch from 549ac3a to 86b1c2f Compare December 6, 2022 21:04
@flavorjones flavorjones merged commit 4ec66eb into main Dec 7, 2022
@flavorjones flavorjones deleted the flavorjones-fix-reader-error-handling_main branch December 7, 2022 21:34
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 this pull request may close these issues.

None yet

1 participant