W3C home > Mailing lists > Public > xml-editor@w3.org > July to September 1998

Re: parameter entity expansion

From: C M Sperberg-McQueen <cmsmcq@uic.edu>
Date: Tue, 11 Aug 1998 14:07:19 -0500
Message-Id: <199808111907.OAA242830@tigger.cc.uic.edu>
To: richard@goon.stg.brown.edu
CC: xml-editor@w3.org, cmsmcq@uic.edu
>Date: Tue, 11 Aug 1998 14:22:17 -0400
>From: "Richard L. Goerwitz III" <richard@goon.stg.brown.edu>

>Just as
>  <!ENTITY % firstpart "<!ELEMENT">
>is invalid, so also should
>  <!ENTITY % firstpart "'start">

The first declaration is not, in itself, invalid.

>  Parameter entities may not expand to partial quoted strings
>  such as "'start" or "end&#39;".
>The reason it would be a bad idea to allow "'start" or "end&#39;"
>is that people will try things like:
>  <!ENTITY % firstpart "'start">
>  <!ENTITY % lastpart "end'">
>  <!ENTITY bothparts %firstpart;%lastpart;>

The example shown is illegal in SGML and should, I believe, be
illegal in XML; I need to consult the spec to see whether the current
wording effectively forbids it or not.  Note, however, that the
following example is legal SGML and should, I believe, be legal in

  <!ENTITY % firstpart "'start">
  <!ENTITY % lastpart "end'">
  <!ENTITY bothparts "%firstpart;%lastpart;">
  <!ENTITY legal     %bothparts; >

When the work group discussed the constraints on parameter entities,
the discussion made clear that although token-pasting of the kind
shown in this example can be confusing and error-prone, it is
nevertheless necessary for some things which the work group was 
loath to forbid.

>Does this make sense?

I think so.

-C. M. Sperberg-McQueen
Received on Tuesday, 11 August 1998 15:08:58 UTC

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