Fw: CDATA in attribute values

I think that the interpretation of W3C validator is wrong of me.

Without a part of elements (e.g. SCRIPT), can't include meta characters in texts.
In short, <img src="foo.gif" alt="&lt;![CDATA[ Jack &amp; Jill ]]&gt;" /> is valid, however, this markup isn't expected for author.
Should be written <img src="foo.gif" alt="Jack &amp; Jill" />.

----- Original Message ----- 
From: "Christian Smith" <csmith@barebones.com>
To: <www-html@w3.org>
Sent: Friday, December 01, 2000 12:22 AM
Subject: CDATA in attribute values


> I this valid?
> 
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <title>Untitled</title>
> <meta name="generator" content="BBEdit 6.0.1" />
> </head>
> <body>
> <img src="foo.gif" alt="<![CDATA[ Jack & Jill ]]>" />
> 
> and even this
> 
> <img src="foo.gif" alt="<![CDATA[ <p>'Jack & Jill'</p> ]]>" />
> 
> and this
> 
> <img src="foo.gif" alt="<?xml <p>'Jack & Jill'</p> ?>" />
> 
> </body>
> </html>
> 
> The W3C validator seems happy with this and my reading of the Annotated
> XML seems to indicate that this is valid.
> 
> -- 
> Christian Smith  |  csmith@barebones.com  |  http://web.barebones.com
> 
> He who dies with the most friends... Is still dead!
> 
> 

Received on Friday, 1 December 2000 02:45:54 UTC