[Expat-discuss] Bug? Illegal parameter reference error for valid document

Karl Waclawek karl@waclawek.net
Mon Nov 5 06:49:10 2001


I ran Expat 1.95.2 against James Clark's test cases version 1998-11-18.
There are two files in the directory \valid\not-sa, which are supposed
to be valid, but Expat returns an "illegal parameter entity reference"
error. Is this a bug, or are the test cases outdated, or am I doing something wrong?

Here is how it looks for the first file:

File 004.xml:
<!DOCTYPE doc SYSTEM "004-1.ent">
<doc></doc>

File 004-1.ent:
<!ELEMENT doc EMPTY>
<!ENTITY % e1 SYSTEM "004-2.ent">
<!ENTITY % e2 "%e1;">  --> Expat does not seem to like "%e1;"
%e1;

File 0004-2.ent:
<!ATTLIST doc a1 CDATA "value">

And the second file:

File 003.xml:
<!DOCTYPE doc SYSTEM "003-1.ent">
<doc></doc>

File 003-1.ent:
<!ELEMENT doc EMPTY>
<!ENTITY % e SYSTEM "003-2.ent">
<!ATTLIST doc a1 CDATA %e; "v1">  --> Expat does not seem to like %e

File 003-2.ent: empty file

Is it possible that I am doing something wrong, maybe
in calling the external entity reference handler?

Karl