fix withDTDParsingDisabled to actually reject doctype declarations#326
Conversation
|
Thank you @jmestwa-coder in particular for also providing a test. I believe I wanted to disable DTD parsing by default and would thus not want to remove the line from The validation package has DTD parsing enabled but is sing SAXParser rather than DocumentBuilder - there I still believe DTD parsing should remain enabled. |
e1a9562 to
3a28d4e
Compare
|
Makes sense. Kept the line in Default so it disables DTD parsing as you intended; the method fix just makes that line actually do something now. Flipped my Default test to assert it rejects a doctype instead of allowing one, and left the SAXParser-based validation path alone. |
|
thank you |
|
While testing things before I must have done something wrong as now tests fail, which is good :-) I'll introduce a new Configuration for the cases where you want DTD processing but no external DTDs. |
withDTDParsingDisabled() set disallow-doctype-decl to false so it disabled nothing; flip it to true, and drop the now-effective call from Default which must keep parsing doctypes.