[Home] [By Thread] [By Date] [Recent Entries]

  • To: xml-dev@l...
  • Subject: Re: More questions about conformance and entities
  • From: richard@i... (Richard Tobin)
  • Date: Mon, 25 Oct 2004 23:58:34 +0100 (BST)
  • Cc:
  • In-reply-to: <417D7B88.4030304@j...>
  • Organization: HCRC, University of Edinburgh


>Doc5.xml
>========
><!DOCTYPE doc SYSTEM "doc5.dtd">
><doc>&gen_foo;</doc>
>
>Doc5.dtd
>========
><!ELEMENT doc (foo)>
><!ELEMENT foo EMPTY>
><!ENTITY % pe_foo "<foo>">
><!ENITY gen_foo "&#37;pe_foo;</foo>">
>
>Now, the replacement text for gen_foo after it is scanned becomes:
>
>%pe_foo;</foo>
>
>It is obvious that the reference to gen_foo would violate WFness. The 
>question is: is this a PE inside the DTD and inside content-- thus 
>violating "Well-formedness constraint: In DTD" while simultaneously 
>being "recognized"? : )

Because gen_foo is not referenced in the DTD, the %pe_foo; in its
replacement text is never interpreted as a parameter entity reference.
Indeed, if you didn't have the </foo> in there the document would be
well-formed, containing this:

  <doc>%pe_foo;</doc>

(% is just another character in the instance).

There's no way to get a % in a general entity to be interpreted as
a parameter entity; general entities aren't ever expanded in a context
where their replacement text is interpreted that way.  Even in a
default attribute value (which is in a sense "in the DTD"), % has no
special meaning: the production for default attribute values is
AttValue which doesn't include PEReference.

-- Richard

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member