Re: Simple(?) question on obscure comments detail

Murray Altheim (murray@spyglass.com)
Sun, 22 Sep 1996 17:37:30 -0500


Message-Id: <v02110103ae6b691bab15@[192.168.22.85]>
Date: Sun, 22 Sep 1996 17:37:30 -0500
To: Foteos Macrides <MACRIDES@SCI.WFBR.EDU>
From: murray@spyglass.com (Murray Altheim)
Subject: Re: Simple(?) question on obscure comments detail
Cc: www-html@w3.org

Foteos Macrides <MACRIDES@SCI.WFBR.EDU> writes:
>murray@spyglass.com (Murray Altheim) wrote:
>>[...] An SGML markup declaration
>>begins with a "markup declaration open" (MDO), which in the reference
>>concrete (ie., default) syntax is defined as:
>>
>>    <!
>>
>>Following immediately after this (no whitespace) is the declaration type.
>>There are 13 types of markup declarations in SGML, but only one is allowed
>>in the document instance: the comment declaration.
>
>        Perhaps this is a problem of me not yet being clear on the precise
>meanings of SMGL terms, but isn't it now two for HTML:
>
>        <!--
>
>and:
>        <!DOCTYPE

You're fine on the terms. I wrote:
>Following immediately after this (no whitespace) is the declaration type.
>There are 13 types of markup declarations in SGML, but only one is allowed
>in the document instance: the comment declaration. All others are specific
>to the document prologue (SGML declaration, DTD, etc.). [...]

You may find both comment and DOCTYPE declarations in an HTML _file_, but
the structure of an HTML _document_ includes both the prologue and document
instance, so the DOCTYPE is considered part of the prologue. This is one of
the interesting parts of SGML: you preface your content with the
specification of its markup structure.

You could theoretically include the entire DTD in the prologue, rather than
just referencing it as a piece of PUBLIC text. You can also include a
modified SGML declaration, as is being done for the internationalized HTML
DTD that handles the extended character set:

     BASESET  "ISO Registration Number 176//CHARSET
               ISO/IEC 10646-1:1993 UCS-2 with
               implementation level 3//ESC 2/5 2/15 4/5"

Current HTML-only browsers wouldn't understand modifications to the
prologue (most ignore it entirely), but an SGML browser would.

Prologue:
     <!SGML  "ISO 8879:1986"   ...   >                  (assumed)
     <!DOCTYPE html PUBLIC "-//IETF//DTD HTML//EN">

Document instance (the "HTML element"):
     <HTML>
     [...]
     </HTML>

>        Also, wouldn't a real SGML parser handle comments in a DOCTYPE
>declaration, but they are presently excluded, or at perhaps "disrecommended",
>there for HTML?

Such as?

    <!DOCTYPE html PUBLIC "-//IETF//DTD HTML//EN"
           -- this is a reference to the HTML 2.0 DTD -->

Certainly not recommended (as some browsers might be confused), but valid.

Murray

```````````````````````````````````````````````````````````````````````````````
     Murray Altheim, Program Manager
     Spyglass, Inc., Cambridge, Massachusetts
     email: <mailto:murray@spyglass.com>
     http:  <http://www.cambridge.spyglass.com/murray/murray.html>
            "Give a monkey the tools and he'll eventually build a typewriter."