Open nektarios-kitsios opened 11 months ago
Attached is a patch with a unit test that demonstrates this case and a potential fix: Issue184-_potential_fix_and_unit_test.patch.txt
Thank you for reporting this issue. Interesting that this was not covered by the extensive XMLTest suite (I think maybe https://www.w3.org/XML/Test/ but it has been years) that had ~2000 tests, many focusing on DTD aspects.
I hope to find time to at least get test integrated and then have a look at proposed solution.
Attached is a new version of the patch that fixes a problem with parameter entity overrides (demonstrated in a unit test). To solve this the external subset is read twice, but there may be better ways to fix this.
@nektarios-kitsios Apologies for slow follow up here. Would it be possible to split patch in two parts: one for unit tests, another for actual fix? I should be able to merge tests first (and move under failing
until fixed), and could see how fix itself would work.
As requested, split the patch in two parts:
Issue184-_unit_tests.patch.txt Issue184-_potential_fix.patch.txt
Thank you!
Validation fails with the error below when a NOTATION that is declared in an external DTD subset is referenced in an internal DTD subset:
The following example demonstrates this problem:
XML:
DTD:
Note that Xerces and xmllint validate the above XML successfully. This is in accordance with the XML specification which does not impose any specific order in the declarations. The only requirement is the following:
The problem seems to be that woodstox reads the internal subset before the external one, and reports the error at the time the internal subset is read when the notation declaration has not been read yet.
For the record there used to be an old issue reporting this problem here: https://web.archive.org/web/20150507153747/http://jira.codehaus.org/browse/WSTX-264