W3C home > Mailing lists > Public > xml-editor@w3.org > October to December 2001

PEReferences in Entity Values of the Internal Subset

From: Dieter Köhler <dieter.koehler@ppp.uni-bamberg.de>
Date: Wed, 19 Dec 2001 00:09:31 +0100
Message-ID: <3C1FCCAB.71A68A50@ppp.uni-bamberg.de>
To: xml-editor@w3.org
Given the following XML document

<!DOCTYPE doc [
  <!ELEMENT doc ANY>
  <!ENTITY % bar "test" >
  <!ENTITY   foo "%bar;" >
]>
<doc>&foo;</doc>

the PEReference %bar; is according to the WFC "PEs in Internal Subset" ("In the
internal DTD subset, parameter-entity references can occur only where markup
declarations can occur, not within markup declarations") not recognized.  So the
replacement text of the entity 'foo' is '%bar;' and the resolved content of the
XML document is

<doc>%bar;</doc>

Given the following XML document

<!DOCTYPE doc [
  <!ELEMENT doc ANY>
  <!ENTITY % bar "test" >
  <!ENTITY   foo "%bar" >
]>
<doc>&foo;</doc>

the entity declaration of foo is not well-formed (cf. prod. [9]).

Comparing these cases the treatment of the '%' character seems to be
inconsistent.  The first document passes a WF-test due to a PEReference which is
then not recognized, while the second document violates a WFC, though the '%'
character in an entity value of an internal subset will never signify the start
of a PEReference.

So it is either superfluous to consider PEReferences in the prod. of
EntityValue, which should then read

[9] EntityValue ::= '"' ([^&"] | Reference )* '"'
                    | "'" ([^&'] | Reference )* "'"

or the WFC "PEs in Internal Subset" should be modified to read:

"In the internal DTD subset, parameter-entity references can occur only where
markup declarations can occur or in an internal entity's literal entity value
..."  (Am I right, that this was the intention of the XML spec? Cf. also the
definition of "Reference in Entity Value" in 4.4. and "Included in Literal" in
4.4.5. However, these are not making an explicit statement about internal
subsets)

-- 
=====================================================================
 Dieter Köhler, M. A. - dieter.koehler@ppp.uni-bamberg.de
 Schiffgasse 4a, D-69117 Heidelberg, +49(0)6221-485995
 "http://www.philo.de/Philosophie-Seiten/": 1000+ Philosophie-Links
 "http://www.philo.de/VirtualLibrary/14.de.htm": Deutsche Philo-Links
 "http://www.philo.de/xml/": Open XML - XML-Komponenten für Delphi
=====================================================================
Received on Tuesday, 18 December 2001 18:11:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:31 GMT