W3C home > Mailing lists > Public > www-html@w3.org > March 2005

Re: why, e.g., input/@checked="checked" ?

From: Robert Koberg <rob@koberg.com>
Date: Sat, 26 Mar 2005 07:34:20 -0800
Message-ID: <424580FC.4070004@koberg.com>
To: www-html@w3.org

David Dorward wrote:
> On Sat, Mar 26, 2005 at 07:19:15AM -0800, Robert Koberg wrote:
> 
>>> <input ... true>
> 
> 
>>It is probably a lack of understanding in SGML, but I don't understand 
>>why you use true there and not checked.
> 
> 
> To demonstrate why having true/false as values for the checked
> attribute would be a bad idea. It isn't a valid code example.
>  
> 
>>Anyway, next I'll ask why is the following invalid?
>>
>><input ... checked="">
> 
> 
> The _only_ value allowed for the attribute is 'checked'. A null string
> is not 'checked' and so isn't allowed. If the attribute is present
> then it must have the value 'checked'.
> 

I understand that. I was asking why.

What I am trying to say is that it makes generating XHTML output 
clumsy/redundant because a source XML used in an XSL transformation to a 
templating language for runtime cannot look like (velocity):

<input #if($isChecked)checked="checked"#end/>

or (jsp):

<input <%=if(isChecked)checked="checked";%>/>

I realize it is not the goal of the HTML working to accomodate these 
situations. It just doesn't seem logical to me. I was wondering if there 
was a logical explanation.

thanks,
-Rob
Received on Saturday, 26 March 2005 15:34:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:16:02 GMT