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

  • From: David Brownell <db@E...>
  • To: roddey@u...
  • Date: Mon, 01 Mar 1999 14:14:57 -0800

roddey@u... wrote:
> 
> Does the following violate the 'partial markup in entity' rule of XML?
> 
> <!ENTITY Part1 "<!ELEMENT ">
> <!ENTITY Part2 " Bubba ANY>">
> <!ENTITY Whole "%Part1;%Part2">
> %Whole;

I'll assume you intended to work with parameter entities; then as Richard
pointed out this can be legal ... if the three syntax errors are corrected
("<ENTITY % Part" twice, "%Part2;") AND if this is found in an external
parameter entity not an internal one (which disallows PEs inside entity
declarations -- a WF constraint).


> So I'm assuming
> that this is ok, that the prohibition against partial markup refers to the
> eventual use of the entity, not to the definition thereof?

Right -- this would violate _validity_ constraints (but a nonvalidating
parser should accept it just fine):

	<!DOCTYPE Bubba [
	  <!ENTITY % Part1 "<!ELEMENT ">
	  <!ENTITY % Part2 " Bubba ANY>">
	  <!-- next is a validity error in both internal
		 and external subsets -->
	  %Part1;%Part2;
	]>
	<Bubba></Bubba>

Another way to make an error out of your declarations is to make the
PEs be external, not internal -- then they'd not match full grammatical
productions.

- Dave

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


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