encoding/xml: does not parse internal subset of DTD as required by standard #68388
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Go version
1.22 I believe
Output of
go env
in your module/workspace:What did you do?
Parse XML files with ill-formed or misplaced directives, such as:
<!BOGUS><a/>
https://go.dev/play/p/ZzfA0W3EUMJ has an example.
What did you see happen?
Documents are wrongly accepted, in violation of the XML spec.
What did you expect to see?
Either
encoding/xml
performs the checks on directives that non-validating parsers must perform, or all directives (including DTDs) are rejected by default. The latter is what .NET’s XML parser does: by default, DTDs are a fatal parse error.The text was updated successfully, but these errors were encountered: