W3C home > Mailing lists > Public > www-html-editor@w3.org > April to June 2001

Re: html comments?

From: Masayasu Ishikawa <mimasa@w3.org>
Date: Sat, 19 May 2001 14:11:17 +0900
To: montbriand@apple.com
Cc: www-html-editor@w3.org
Message-Id: <20010519141117C.mimasa@w3.mag.keio.ac.jp>
John Montbriand <montbriand@apple.com> wrote:

> re: http://www.w3.org/TR/WD-html40-970708/

This is very old Working Draft, you'd better look at:


> I have been looking for some information about placement of html
> comments.  Namely, <!-- ... --> style things in html text.  Now,
> such comments can be used to comment out sections of html, and
> and as such, they may contain html tags.  Now, I'm wondering,
> is the converse true?  i.e., can html comments be placed inside
> of html tags?  I've looked through he standards and there's no
> discussion of this.

The short answer is no.  Markup declarations (including comment
declaration) cannot appear inside markup.  You should refer to
the SGML standard for details, but in the case of XHTML, which
is written in XML syntax, XML 1.0 is very clear on this:


    [Definition: Comments may appear anywhere in a document outside other
    markup; in addition, they may appear within the document type
    declaration at places allowed by the grammar. They are not part of
    the document's character data; an XML processor may, but need not,
    make it possible for an application to retrieve the text of comments.
    For compatibility, the string "--" (double-hyphen) must not occur
    within comments.] Parameter entity references are not recognized
    within comments.

  cf. http://www.w3.org/TR/2000/REC-xml-20001006#sec-comments

Masayasu Ishikawa / mimasa@w3.org
W3C - World Wide Web Consortium
Received on Saturday, 19 May 2001 01:10:55 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:08:26 UTC