Re: changes?

2012-02-02 3:24, Michael wrote:

> I was taking an HTML class and I recall my code being valid. My teacher
> marked me down because he stated it was invalid.
>
> I checked and indeed now it does show an error, but back in December, I
> didn't see this. Unless I made a mistake with the file I sent, something
> has changed.
> Did it?

I don't think there has been any significant change in this respect. 
Error messages like this have been reported in the www-validator list at 
least in 2005 and in 2007, suggesting that the validator has enforced 
the SGML comment syntax, which tends to confuse people.

> This was the line that caused it to be invalid:
>
> Error /Line 327, Column 31/: invalid comment declaration: found name
> start character outside comment but inside comment declaration
>
> |<!--Ceci n'est pas une table--*v*raisment!	|

The second occurrence of "--" terminates the comment, and then the 
letter "v" is what the message says: a name start character (a letter) 
outside comment but inside comment declaration.

In practical terms, a comment should start with "<!--" and end with 
"-->" so that there is no "--" pair between them.

The formal rule is more complicated. What we commonly call "comment" is 
formally "comment declaration", starting with "<!" and ending with ">", 
containing any number of "comments" between them, and nothing else, 
except whitespace. A "comment", in this terminology, starts and ends 
with "--". Reference: ISO 8879, clause 10.3.

It is a bit of a mystery to me why the validator says "name start 
character" here. It isn't relevant that the character is a name start 
character, or a name character, or a "*" character, or whatever. The 
relevant thing is that it is a non-whitespace character outside comment 
but inside comment declaration.

Yucca

Received on Monday, 6 February 2012 07:53:01 UTC