Skip to content

Wrap SAX content validation failures as parse errors - #224

Open
carrerasdarren-cell wants to merge 1 commit into
hunterhacker:masterfrom
carrerasdarren-cell:fix-xml11-illegal-data-parse-error
Open

Wrap SAX content validation failures as parse errors#224
carrerasdarren-cell wants to merge 1 commit into
hunterhacker:masterfrom
carrerasdarren-cell:fix-xml11-illegal-data-parse-error

Conversation

@carrerasdarren-cell

Copy link
Copy Markdown

Summary

  • wrap IllegalDataException raised while SAX callbacks construct JDOM content in JDOMParseException
  • preserve the original cause and partial document, matching the existing SAX error path
  • add a regression for an XML 1.1 character accepted by the parser but rejected by JDOM's XML 1.0 verifier

This keeps SAXBuilder.build() failures inside its declared JDOMException contract instead of allowing an unchecked exception to escape.

Fixes #223.

Testing

  • Untouched reproducer: XML 1.0 is handled as JDOMParseException; XML 1.1 escapes as IllegalDataException
  • Patched reproducer: both inputs are handled as JDOMParseException
  • Isolated new JUnit regression: 1 test, 0 failures
  • Full Ant suite: 1,904 tests, 0 errors; the new regression passes. The 13 failures are in existing temporary-file URI and StAX output expectations on the modern Java/macOS test environment.

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.

SAXBuilder.build() throws an undeclared unchecked exception on valid XML 1.1

1 participant