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?

Galactus
[0] <URL:http://www.webtechs.com/html-val-svc/>
-- 
To find out more about PGP, send mail with HELP PGP in the SUBJECT line to me.
E-mail: galactus@stack.urc.tue.nl - Please PGP encrypt your mail if you can.
Finger galactus@turtle.stack.urc.tue.nl for public key (key ID 0x416A1A35).
Anonymity and privacy site: <http://www.stack.urc.tue.nl/~galactus/remailers/>

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