Re: STYLE & SCRIPT

Murray Altheim (murray@spyglass.com)
Tue, 29 Oct 1996 01:54:12 -0500


Message-Id: <v02140b0bae9b57f99a8c@[208.203.149.85]>
Date: Tue, 29 Oct 1996 01:54:12 -0500
To: Peter Flynn <pflynn@curia.ucc.ie>
From: murray@spyglass.com (Murray Altheim)
Subject: Re: STYLE & SCRIPT
Cc: www-html@w3.org, walter@natural-innovations.com

Peter Flynn <pflynn@curia.ucc.ie> writes:
>At 7:38p +0100 10/27/96, Arnoud "Galactus" Engelfriet wrote:
>   There's just one more for now. Are comments allowed inside HTML tags or only
>   inside SGML declarations. That is, is <A HREF = -- parse me :)--
>"file.html">
>   legal?
>
>No. Comments inside angle brackets are only allowed in declarations
>like
>
>   <!entity foo "bar" -- sample -->
>
>(not 100% true, I think, more a working definition).

Well, the way it's expressed in both SGML books and RFC 1866 is that the
only place that comments may occur in an HTML document instance (between
the <HTML> and </HTML> tags) is in a comment declaration. You can put
comments within declarations in the declaration subset, but that's not
technically within the document instance, and not supported in too many
browsers I'm aware of...

Walter Ian Kaye <walter@natural-innovations.com> writes:
>At 7:38p +0100 10/27/96, Arnoud "Galactus" Engelfriet wrote:
>>> There's just one more for now. Are comments allowed inside HTML tags or only
>>> inside SGML declarations. That is, is <A HREF = -- parse me :)--
>>>"file.html">
>>> legal?
>>
>>It's not, according to the Webtechs validator. And comments belong
>>in SGML declarations, not in tags, so it's logical that it does
>>not validate.
>
>Of course, one could do something like
><A HREF="file.html" MYCOMMENT="parse me :)" ALT="Unknown att/val ignored">
>if one wished...

Yes, one could, but one's document would not be valid. While HTML
application conventions state that unknown elements and attributes are to
be ignored by UAs, that doesn't mean that from a parsing/validation
standpoint it's legal. If it's not in the DTD it's going to show up as an
error. Why not simply put the comment before the tag? Much easier and less
confusing to anyone reading the code, given that most people's
understanding of HTML doesn't include how SGML comments work.

Murray

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