Re: Comments in markup?

Joe English (joe@trystero.art.com)
Tue, 30 Jul 1996 10:46:58 PDT


Message-Id: <9607301747.AA25509@trystero.art.com>
To: www-html@w3.org
Subject: Re: Comments in markup? 
In-Reply-To: <JXe/x4uYOJXZ089yn@stack.urc.tue.nl> 
Date: Tue, 30 Jul 1996 10:46:58 PDT
From: Joe English <joe@trystero.art.com>


galactus@stack.urc.tue.nl (Arnoud "Galactus" Engelfriet) wrote:

> Ah, ok. But why does the WebTechs validator complain when I feed an
> HTML document containing an <!ENTITY> declaration (copied from the
> HTML 3.2 DTD, but with a different name to avoid duplicates) to it?
> Shouldn't it be possible to declare new entities in an HTML document?
> 
> Or is there simply a restriction on *where* such declarations may be
> used?


Yes:  ENTITY, ELEMENT, and ATTLIST declarations can only
appear inside a document type definition.

To add local entity declarations to an SGML document,
you can put them in the DTD _internal subset_, a la:

	<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"
	[
	    <!ENTITY foo "replacement text here...">
	    <!ENTITY bar SYSTEM "http://www.wherever.com/whatever">
	]>
	<html>
	<head><title>...</title></head>
	<body>
	<p>&foo; &bar;
	</body>
	</html>

The only declarations that are legal in the document instance
are comment declarations and <!USEMAP> declarations (don't ask :-);
plus the initial <!SGML ...>, <!DOCTYPE ...>, and optional <!LINKTYPE ...>
declarations, which must precede the instance.



--Joe English

  joe@art.com