Comments in markup?

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?

[0] <URL:>
To find out more about PGP, send mail with HELP PGP in the SUBJECT line to me.
E-mail: - Please PGP encrypt your mail if you can.
Finger for public key (key ID 0x416A1A35).
Anonymity and privacy site: <>

Received on Monday, 29 July 1996 15:26:15 UTC