Re: Comments in markup?

Joe English (
Tue, 30 Jul 1996 10:46:58 PDT

Message-Id: <>
Subject: Re: Comments in markup? 
In-Reply-To: <JXe/> 
Date: Tue, 30 Jul 1996 10:46:58 PDT
From: Joe English <> (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:

	    <!ENTITY foo "replacement text here...">
	    <!ENTITY bar SYSTEM "">
	<p>&foo; &bar;

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