Re: [VE][53] New Error Message Suggestion

On Mon, 24 May 2004, Kerr Edward wrote:

> I obtained the following error:
>
> Line 100, column 12: invalid comment declaration: found name start character
> outside comment but inside comment declaration
>
> <!-- ------ Main data table starts here ------ -->
>
> The M was in red.

Technically, that's how things are by SGML rules. I don't know how it
could be explained simply, since there is a widespread misunderstanding on
what a comment is.

> I was understand that one could put any characters in a comment.

Well, as long as they don't contain two consecutive hyphens, since "--"
ends a comment.

What is commonly called a comment is actually a comment declaration, which
may contain one or more comments. The construct
<!-- ------ Main data table starts here ------ -->
actually contains several comments (again, by SGML rules; browsers are
known to have broken parsers). The first one is
-- --
and the second one is
----
and the the problems start.

In practical terms, the only comment declaration syntax that should ever
be used in HTML is one that starts with <!-- and ends with --> and does
not contain any consecutive hyphens between them, or any hyphen
immediately before the ending -->. The SGML rules permit other variants
as well, but the rules do _not_ correspond to intuitive expectations.

To use a comment declaration that "stands out" as a divider, don't use
---- but e.g. **** or ____.

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

Received on Monday, 24 May 2004 06:51:38 UTC