Re: Comments in markup?

Murray Altheim (murray@spyglass.com)
Mon, 29 Jul 1996 17:15:49 -0500


Message-Id: <v02110108ae22e711597e@[140.186.34.50]>
Date: Mon, 29 Jul 1996 17:15:49 -0500
To: galactus@stack.urc.tue.nl (Arnoud "Galactus" Engelfriet)
From: murray@spyglass.com (Murray Altheim)
Subject: Re: Comments in markup?
Cc: www-html@w3.org

galactus@stack.urc.tue.nl (Arnoud "Galactus" Engelfriet) writes:
>Yesterday I received an e-mail from someone who wanted to know more
>about HTML comments. I explained how they worked, and she then came
>up with the idea that you could embed comments in HTML tags then:
><A HREF="foo" -- A link to foo -->click here</A> would, according to
>her, be technically legal. Webtechs[0] didn't agree.
>
>When I tested this myself, I found out I couldn't use any SGML constructs
>other than DOCTYPES or comment elements in an HTML document when feeding
>it to the Webtechs validator. Is there a reason for this? Why would an
>SGML parser allow <!-- foobar --> but not <!ENTITY foobar ...>, both of
>which are valid SGML constructs?

Comments are only allowed in declarations. And the only declarations within
HTML document instances you'll find are comment declarations -- all the
rest is considered markup. You'll note that you can't put <!ENTITY ..>
declarations within the document instance either.

Murray

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