W3C home > Mailing lists > Public > www-validator@w3.org > September 2005

Re: Validator doesn't complain about & in meta content

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Wed, 28 Sep 2005 07:58:51 +0300 (EEST)
To: "Edmondson, Michael" <Michael.Edmondson@turner.com>
Cc: www-validator@w3.org
Message-ID: <Pine.GSO.4.63.0509280752200.13237@korppi.cs.tut.fi>

On Tue, 27 Sep 2005, Edmondson, Michael wrote:

>    <meta name="Title" content="I like XML & XSL!">
>    <meta name="Description" content="I like M&Ms.  Yum!">
- -
> Expectation
> -----------
> The Validator should complain about ampersands not represented as entities.

Wrong expectation in SGML validation (which you are using). By SGML rules,
an ampersand is allowed as a data character when not immediately followed 
by a name start character or by the number sign "#".

> The Validator only complains about the second mistake, finding an invalid
> entity.

Technically, it is an undefined entity reference, but the net effect is 
that the document is invalid. (If you had e.g. "I like nice&shy people"
instead, the document would be valid, since &shy is a correct entity 
reference by HTML 4 rules. In XHTML, it would be invalid due to the lack 
of the terminating ";".)

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
Received on Wednesday, 28 September 2005 04:58:55 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:20 GMT