[whatwg] Ambiguous ampersand

Øistein E. Andersen liszt at coq.no
Tue Sep 8 14:57:23 PDT 2009


According to § 9.1.4 Character references, "An ambiguous ampersand is  
a U+0026 AMPERSAND (&) character that is followed by some text other  
than a space character, a U+003C LESS-THAN SIGN character ('<'), or  
another U+0026 AMPERSAND (&) character", text being "allowed inside  
elements, attributes, and comments" (§ 9.1.3 Text). (Should that be  
"attribute values"? Either is probably acceptable.)

This text does not seem to define the ampersand in <element attr=&> as  
ambiguous, but it still causes a parse error. <element attr=& attr2>,  
<element attr="&"> and <element attr='&'> are all conforming, so the  
most consistent solution would probably be to remove the parse error  
by setting the "additional allowed character" to '>' when encountering  
an ampersand in the "Attribute value (unquoted)" state.

Also, making the sequence "&<" conforming in (quoted) attribute  
values, where the '<' occurs as text, seems inconsistent.

-- 
Øistein E. Andersen


More information about the whatwg mailing list