W3C home > Mailing lists > Public > www-validator@w3.org > December 2000

Fw: CDATA in attribute values

From: Yuu Morita <yuu@os.rim.or.jp>
Date: Fri, 1 Dec 2000 16:45:49 +0900
Message-ID: <05e401c05b6a$b9c4b030$1300a8c0@yuu1>
To: <www-validator@w3.org>
Cc: <www-html@w3.org>
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 GMT

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