When I was trying to parse a XML containing attribute list declarations the parser threw the error "Invalid DOCTYPE". I figured that readDocType(...) wasn't aware of attribute list (<!ATTLIST>) and notation (<!NOTATION>) declarations, which causes the parser to throw an error despite them being valid.
Edit:
Later when I was trying to parse another XML I noticed that that the parser could bug out if there's a < (left angle bracket) within a comment, or throw the error "Invalid XML comment in DOCTYPE" if there's a > (right angle bracket) within a comment. I've included a fix for this too in this PR. I also made the string "--" (double-hyphen) prohibited within comments to respect the XML specifications.
Purpose / Goal
Adds awareness of missing DTD declarations
Allow angle brackets within comments in DOCTYPE
Type
Please mention the type of PR
[x]Bug Fix
[ ]Refactoring / Technology upgrade
[ ]New Feature
Note : Please ensure that you've read contribution guidelines before raising this PR. If your PR is in progress, please prepend [WIP] in PR title. Your PR will be reviewed when [WIP] will be removed from the PR title.
Coverage decreased (-0.08%) to 98.491% when pulling e102792310cd7c47d8485b3055d91f7e311bc9b4 on Hati-:patch-doctype-decl into 383b836b1bdb076fd85e744f41a5b2bc6a6e8466 on NaturalIntelligence:master.
When I was trying to parse a XML containing attribute list declarations the parser threw the error "Invalid DOCTYPE". I figured that
readDocType(...)
wasn't aware of attribute list (<!ATTLIST>
) and notation (<!NOTATION>
) declarations, which causes the parser to throw an error despite them being valid.Edit: Later when I was trying to parse another XML I noticed that that the parser could bug out if there's a
<
(left angle bracket) within a comment, or throw the error "Invalid XML comment in DOCTYPE" if there's a>
(right angle bracket) within a comment. I've included a fix for this too in this PR. I also made the string "--" (double-hyphen) prohibited within comments to respect the XML specifications.Purpose / Goal
Type
Please mention the type of PR
Note : Please ensure that you've read contribution guidelines before raising this PR. If your PR is in progress, please prepend
[WIP]
in PR title. Your PR will be reviewed when[WIP]
will be removed from the PR title.Bookmark this repository for further updates.
Benchmark
Before
After