RE: ID and NAME tokens (CDATA problems)

Bjoern Hoehrmann wrote:
>* Peter Foti (PeterF) wrote:
>>The HTML 4 recommendation states that:
>>
>>ID and NAME tokens must begin with a letter ([A-Za-z]) and 
>may be followed
>>by any number of letters, digits ([0-9]), hyphens ("-"), 
>underscores ("_"),
>>colons (":"), and periods ("."). 
>>
>>http://www.w3.org/TR/html4/types.html#type-cdata
>
>>Thus, if a form is defined as follows:
>>
>><form action="" name="myform">
>>   <input name="readme.txt-title">
>>   <input name="readme.txt-author">
>></form>
>
>Please note that the name attributes in HTML are CDATA attributes not
>NAME or ID attributes, thus you could also use e.g. name="foo bar".

Indeed, you are correct.  I followed the CDATA link in the spec (from the
name attribute of the INPUT element), and then mistakenly read the ID and
NAME tokens to be the HTML 4 attributes having further constraints
(mentioned in the CDATA description).  Now that you have pointed this out,
it is quite clear.  Perhaps the difference in spacing between the list items
confused me the first time around (notice there is additional whitespace at
the end of the CDATA description, but not separating the "ID and NAME...",
"IDREF and IDREFS...", and "NUMBER..." list items).

Thanks.
Peter Foti

Received on Tuesday, 15 July 2003 12:31:57 UTC