Skip to content

MLE-33478: Fix DOCTYPE handling in DOMHandle - #1997

Merged
NiteshMehta merged 1 commit into
developfrom
MLE-33478
Dec 2, 2026
Merged

NiteshMehta merged 1 commit into
developfrom
MLE-33478

Conversation

@ashokrprogress

Copy link
Copy Markdown

MLE-33478

Reject DOCTYPE declarations on the LSParser used to read XML, closing the gap where DocumentBuilderFactory protections did not apply.

Add regression tests for buffer parsing and resolver-configured stream parsing, including stream closure on rejection.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the DOMHandle DOCTYPE-handling fix.

No open issues 🎉

What changed in this PR

Fixes DOCTYPE handling in DOMHandle by configuring the XML-reading LSParser directly, closing a gap in the existing parser protections.

Changes:

  • Reject DOCTYPE declarations even when a resource resolver is configured.
  • Document parsing behavior and stream closure.
  • Add regression tests for buffer rejection and resolver-configured stream rejection, including stream closure.
File Description
marklogic-client-api/​src/​test/​java/​com/​marklogic/​client/​test/​ClosingHandlesTest.java Tests DOCTYPE rejection and stream closure on rejection.
marklogic-client-api/​src/​main/​java/​com/​marklogic/​client/​io/​DOMHandle.java Enables DOCTYPE rejection on LSParser and documents the parsing contract.

Review effort: Balanced

Reject DOCTYPE declarations on the LSParser used to read XML, closing
the gap where DocumentBuilderFactory protections did not apply.

Add regression tests for buffer parsing and resolver-configured stream
parsing, including stream closure on rejection.
@NiteshMehta
NiteshMehta merged commit ca5093e into develop Dec 2, 2026
4 checks passed
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.

4 participants