W3C home > Mailing lists > Public > xml-editor@w3.org > April to June 2004

XML 1.0 3e spec, Scope of parameter entity def?

From: Graham Klyne <gk@ninebynine.org>
Date: Fri, 04 Jun 2004 13:07:42 +0100
Message-Id: <>
To: xml-editor@w3.org

With reference to:
Extensible Markup Language (XML) 1.0 (Third Edition)
W3C Recommendation 04 February 2004

What is the scope of a parameter entity definition?  Is it limited to the 
physical entity in which it appears, or can be carried into/out of external 
parameter entities?


<!DOCTYPE doc [
<!ENTITY % e1 SYSTEM "ExhibitE1.ent">
<!ATTLIST doc a1 CDATA "v1">
<!ATTLIST doc a2 CDATA "v2">

<!ENTITY % e2 SYSTEM "ExhibitE2.ent">

<!ATTLIST doc a3 CDATA "v3">

Is the definition of %e2; in ExhibitE1.ent carried back into the containing 

The specification makes reference to "replacement text" for PEs (sections 
4.4.5, 4.4.8), and also the comment in section 4.3.2 that all external PEs 
are well-formed by definition, suggests that the answer is yes:  the total 
should be treated as if the PEs replacement text is included inline.

If true, this creates something of an implementation problem, because there 
is no clear separation between parsing, and textual substitution that may 
affect the results of parsing.  In order to text to be substituted, 
parameter entity definitions must be parsed.  But the inclusion of 
replacement text may invalidate the parse.

Is an implementation really supposed to handle cases like this ?:

<!ENTITY % percent SYSTEM "percent.ent">
<!ENTITY % pe1 '<!ENTITY percent pe2 "<!ATTLIST doc a1 CDATA &34;v1&34;>">'>
where percent.ent contains just a '%' character, and (&34; == ")


Graham Klyne
For email:
Received on Friday, 4 June 2004 08:08:09 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:37:45 UTC