Re: [VE][53] Error Message Feedback

On Thu, 14 Apr 2005, Liam Quinn wrote:

>     A common error is to include a string of hyphens ("---") within a
>     comment. Authors should avoid putting two or more adjacent hyphens
>     inside comments.
>
>     http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.4

As so many statements related to SGML in the HTML 4 spec, this is actually
an oversimplification. It is not an error by SGML rules (and hence,
formally, by HTML 4 rules) to include a string of hyphens within a comment
declaration, which is what this passage _means_ by "comment". The comment
declaration
<!--foo----bar-->
is valid SGML and consists of two comments
--foo--
and
--bar--
But it is very easy to get things wrong in such cases; hence the "should
avoid" statement (which is as such irrelevant in validation).

The situation is explained well in the good old Web Authoring FAQ at
http://www.htmlhelp.com/faq/html/basics.html#html-comments

> Did you put two or more adjacent hyphens inside the comment?

Most probably Paran did. The code snippet posted does not cause the
error message. Using --- (not followed by yet another hyphen)
causes the message.

On the other hand, if you wish to include copyright information inside
HTML source, without making it part of document body, it might be better
to use a <meta> element. The notice would then appear within an attribute,
inside quotation marks, not in a comment; you would not need to worry
about using hyphens (though you would need to be careful with quotation
marks). More importantly, it would be possible to programs to recognize
the notice as metadata (as opposite to comments, which can be anything),
and perhaps even specifically as copyright metadata. Using the Dublin Core
metadata convention, you could write

<meta name="DC.rights" content="
"Copyright notices. Source code stealing info">

For example, if you view a document on Firefox and select the "view
page information" command in the tools menu, you get the metadata
fields listed in a tabular manner, among other things.

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

Received on Friday, 15 April 2005 04:52:41 UTC