[Expat-bugs] [ expat-Bugs-1156398 ] XML_UseForeignDTD forces incorrect WF checking

SourceForge.net noreply at sourceforge.net
Fri Mar 4 05:18:10 CET 2005


Bugs item #1156398, was opened at 2005-03-03 21:19
Message generated for change (Comment added) made by kwaclaw
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1156398&group_id=10127

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Karl Waclawek (kwaclaw)
>Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: XML_UseForeignDTD forces incorrect WF checking

Initial Comment:

When Expat calls the externalEntityRefHandler within
the prolog,
then it concludes that there must be an external
subset, as there
was an external identifier encountered.
This information influences how the WFC: Entity Declared
is checked.

However, when Expat calls the externalEntityRefHandler
in order
to allow the application to supply an external subset
when there
was none, then Expat should not make this assumption unless
an actual subset has been processed, as indicated by the
dtd->paramEntityRead flag.

The attached patch fixes this.

----------------------------------------------------------------------

>Comment By: Karl Waclawek (kwaclaw)
Date: 2005-03-03 23:18

Message:
Logged In: YES 
user_id=290026

We could use the following document for a test case::

<!DOCTYPE root 
[
<!ELEMENT root (#PCDATA)>
<!ATTLIST root att CDATA #IMPLIED>
<!ENTITY aaa "aString">
]>
<root att="&aAa;">reference doesn't match delaration</root>

This document violates WFC: Entity Declared and Expat must
return an error. However, if this document had an external
subset
then WFC: Entity Declared would not apply.
Now, if one calls XML_UseForeignDTD() at the start of parsing
the document above, then Expat 1.95.8 will accept the document,
which is not correct. The patched version of Expat will return
an error as it should.

Assigned to Fred for testing.
I really want this to be in release 2.0, as it improves the
conformance against the XML_Test-Suite.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1156398&group_id=10127


More information about the Expat-bugs mailing list