jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ben" <apa...@benmeadowcroft.com>
Subject RE: DO NOT REPLY [Bug 25497] New: - Input tags generate invalid XHTML,
Date Sat, 13 Dec 2003 19:08:41 GMT
> -----Original Message-----
> From: Lavandowska [mailto:flanandowska@yahoo.com] 
> Sent: 13 December 2003 14:55
> To: taglibs-dev@jakarta.apache.org
> Subject: Re: DO NOT REPLY [Bug 25497] New: - Input tags 
> generate invalid XHTML,
> 
> 
> 
> --- bugzilla@apache.org wrote:
> > 
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25497
> > 
> > Input tags generate invalid XHTML,
> > 
> > The input tags for forms, options, selects, radio buttons and check 
> > boxes all generate invalid XHTML due to using 
> selected="true" style or 
> > similar. See
> > http://www.w3.org/TR/2002/REC-xhtml1-20020801/#h-4.11 for more info.
> > 
> > examples:
> > action="GET" instead of action="get"
> > encType="..." instead of enctype="..."
> > selected="true" instead of selected="selected"
> > checked="true" instead of checked="checked"
> > 
> > Generating these values creates invalid XHTML (and I don't 
> think the 
> > ="true" syntac is valid HTML either).
> 
> >From the included link: "in XHTML 1 all of these values are 
> defined in
> lower-case" - which means it should be action="get" and enctype="...".
> 
> I don't see anything in that document on checked="checked" vs 
> checked="true".  The recommendation at the time XHTML was 
> first released was to use checked="checked" for compatability 
> with older browsers (though I don't think there was anything 
> magical about the 'value' of the attribute in these cases).

You're correct, I didn't include the additional reference, the first
(original) link refers to the lower case "get" in the form.

The spec for HTML 4 states the available values for form elements (and
specs it for XHTML, being a reformulation of HTML 4.01).
http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html

Event though in HTML things like
<selct multiple>
...options...
</select>

Are valid, this is because of SGML attribute minimalisation.

In the document referenced above you will find the following definition
of select, given as an example:

<!ELEMENT SELECT - - (OPTGROUP|OPTION)+ -- option selector -->
<!ATTLIST SELECT
  %attrs;                              -- %coreattrs, %i18n, %events --
  name        CDATA          #IMPLIED  -- field name --
  size        NUMBER         #IMPLIED  -- rows visible --
  multiple    (multiple)     #IMPLIED  -- default is single selection --
  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
  onfocus     %Script;       #IMPLIED  -- the element got the focus --
  onblur      %Script;       #IMPLIED  -- the element lost the focus --
  onchange    %Script;       #IMPLIED  -- the element value was changed
--
  >
http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#edef-
SELECT

The value in brackets, e.g. (multiple) is *the* value that is implied in
HTML when you use attribute minimisation. In XHTML yo cannot minimise
attributes so this must be explicit, you would use, multiple="multiple".
Also multiple="true" is not valid in either HTML or XHTML (unless
versions earlier the 4.01 allowed it), the values of the attribute are
defined in the HTML and XHTML DTD's.

Ben



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Mime
View raw message