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

Re: NAME and ID attribute types content model

From: Christian Smith <csmith@barebones.com>
Date: Wed, 19 Dec 2001 06:40:39 -0500
To: www-validator@w3.org
cc: Christian Rémillard <christian.remillard@umontreal.ca>
Message-ID: <20011219064057-d01050002-23fa6785-0921-0108@209.245.100.220>
On Tuesday, December 18, 2001 at 20:50, christian.remillard@umontreal.ca
(Christian Rémillard) wrote:

> If i am not mistaken, the HTML 4.0 and following versions define the ID
> and NAME attributes content type as CDATA with some limitations:

Not quite. The data types ID and NAME are defined in a restricted
fashion, but the attribute "name" is generally defined as being of type
CDATA where as the attribute "id" is always defined as being of type ID.

The exception to this is that the attribute "name" of the element "meta"
is defined as being of type NAME.

The validator does catch this

valid   - <a name="1234">
invalid - <meta name="1234" content="some numbers">

Confusing, no doubt, to have an attribute "name" which is defined as
being of type CDATA when it must share the same name space as another
attribute "id" which is defined as being of type ID. Made more so by
there being a data type NAME defined the same as ID.

-- 
Christian Smith  |  csmith@barebones.com  |  http://web.barebones.com

He who dies with the most friends... Is still dead!
Received on Wednesday, 19 December 2001 06:41:01 GMT

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