W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2009

[whatwg] Ambiguous ampersand

From: Řistein E. Andersen <liszt@coq.no>
Date: Tue, 8 Sep 2009 22:57:23 +0100
Message-ID: <DB7E66C6-573C-42B1-ADE8-6B7939E8B355@coq.no>
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
Received on Tuesday, 8 September 2009 14:57:23 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:52 UTC