Definition of Identifier?

IS "--" a valid identifier?


http://www.w3.org/TR/CSS2/syndata.html#value-def-identifier

| In CSS, identifiers  (including element names,
| classes, and IDs in selectors) can contain only the
| characters [a-zA-Z0-9] and ISO 10646 characters
| U+00A1 and higher, plus the hyphen (-) and the
| underscore (_); they cannot start with a digit, or a
| hyphen followed by a digit. Identifiers can also
| contain escaped characters and any ISO 10646
| character as a numeric code (see next item). For
| instance, the identifier "B&W?" may be written as
| "B\&W\?" or "B\26 W\3F".

That should that be changed to: "they cannot start with a digit, or a
hyphen followed by either a digit or a hyphen.

Is this right?

According to the production defined in the scanner:
http://www.w3.org/TR/CSS21/grammar.html#scanner

That would be correct; "--" is not a valid identifier:
ident		-?{nmstart}{nmchar}*
nmstart		[_a-z]|{nonascii}|{escape}
nmchar		[_a-z0-9-]|{nonascii}|{escape}

Garrett

Received on Saturday, 26 June 2010 03:38:04 UTC