On 6/4/09 11:20, Alexei Pshenichnyi wrote:
Hello, guys.

I want to write about 3.2.2 Attributes
<http://www.w3.org/TR/html401/intro/sgmltut.html#h-3.2.2> section of
HTML 4.01 Specification.

I am not sure whether it is wrong or not, but still…

This section specify that the only legal characters for attribute values
are “letters (a-z and A-Z), digits (0-9), hyphens (ASCII decimal 45),
periods (ASCII decimal 46), underscores (ASCII decimal 95), and colons
(ASCII decimal 58)”, meanwhile later in specification I can see that
value of some attributes (e.g. style) can contain semicolons (ASCII
decimal 59).

The full quotation is "In certain cases, authors may specify the value of an attribute without any quotation marks. The attribute value may only contain letters (a-z and A-Z), digits (0-9), hyphens (ASCII decimal 45), periods (ASCII decimal 46), underscores (ASCII decimal 95), and colons (ASCII decimal 58). We recommend using quotation marks even when it is possible to eliminate them."

So could you please clarify whether semicolon is a legal character or not?

Judging from the above:

If the attribute value is delimited with single or double quotation marks, semicolon is a legal character.

alt=";" is legal

If the attribute value is not delimited with single or double-quotation marks, semicolon is an illegal character.

alt=; is illegal

--
Benjamin Hawkes-Lewis

Reply via email to