[ expat-Bugs-548690 ] Incorrect "undefined entity" error
noreply@sourceforge.net
noreply@sourceforge.net
Thu Apr 25 09:38:03 2002
Bugs item #548690, was opened at 2002-04-25 12:37
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=110127&aid=548690&group_id=10127
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Karl Waclawek (kwaclaw)
Assigned to: Nobody/Anonymous (nobody)
Summary: Incorrect "undefined entity" error
Initial Comment:
I came across the following behaviour, given this
document:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE intervalscript SYSTEM 'intervalscript.dtd' [
<!ENTITY % worldupdtd SYSTEM 'worldup.dtd'>
%worldupdtd;
%visiondtd;
]>
<test>
some text
</test>
Expat will report an "undefined entity" fatal error
for the reference %visiondtd;.
However, the XML spec says this (look at the
<emphasis> tag:
<spec>
Well-formedness constraint: Entity Declared
In a document without any DTD, a document with only an
internal DTD subset which contains no
parameter entity references, or a document
with "standalone='yes'", for an entity reference that
does not occur within the external subset or a
parameter entity, the Name given in the entity
reference must match that in an entity declaration
that does not occur within the external subset or
a parameter entity, except that well-formed documents
need not declare any of the following
entities: amp, lt, gt, apos, quot. The declaration of
a general entity must precede any reference to
it which appears in a default value in an attribute-
list declaration.
<emphasis>
Note that if entities are declared in the external
subset or in external parameter entities, a
non-validating processor is not obligated to read and
process their declarations; for such
documents, the rule that an entity must be declared is
a well-formedness constraint only if
standalone='yes'.
</emphasis>
Validity constraint: Entity Declared
In a document with an external subset or external
parameter entities with "standalone='no'", the
Name given in the entity reference must match that in
an entity declaration. For interoperability,
valid documents should declare the entities amp, lt,
gt, apos, quot, in the form specified in 4.6
Predefined Entities. The declaration of a parameter
entity must precede any reference to it.
Similarly, the declaration of a general entity must
precede any attribute-list declaration
containing a default value with a direct or indirect
reference to that general entity.
</spec>
Since Expat is not validating, the emphasized section
should apply.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=110127&aid=548690&group_id=10127