Re: Minimized Tag Values in XHTML Validator

On Tue, 27 Jan 2004, Travis Breaux wrote:

> I was validating a page with an expanded attribute value for which HTML
> 4.0 allows minimized attributes.

(As an aside, it's a little better to use HTML 4.01 than HTML 4.0
these days.)

> For example:
>
> <input type=... checked> becomes <input type=... checked="checked"/>

Why do you use the "/" in HTML 4.0?

> The validator complained that the value I had specified for the expanded
> attribute was incorrect. The XHTML 1.0 specification doesn't actually
> specify what the values are for expanded attributes, although, they give
> an example like the one cited above.

OK, so you use XHTML 1.0, in fact? Anyway, in all versions of HTML, the
attribute named checked is declared with one possible value only, namely
"checked". In the XHTML 1.0 specification, the relevant rule in the DTDs
is (abridged here, omissions indicated with "..."):

<!ATTLIST input
  ...
  disabled    (disabled)     #IMPLIED
  ...
  >

This means, by SGML rules, that if the attribute is present, its value
must be exactly "disabled", literally. In XHTML, the value is even
case-sensitive.

(I don't see why you would want to use any other value. If you wish to
make a field disabled, use the attribute; if not, omit the attribute.
Such "Boolean" attributes are somewhat odd birds in SGML, and effectively
just original command-like design transmogrified into SGML syntax, but
that's a different story.)

> Unless there is a place in the specification that requires expanded
> attribute names must equal attribute values, the XHTML validator is
> incorrect.

Actually, in the shorthand notation <input type=... checked> the string
"checked" is the attribute's _value_, not name, in SGML terms (though HTML
was partially retrofitted into SGML rather than designed as an SGML
application, no matter what the specifications might say).

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

Received on Wednesday, 28 January 2004 09:43:48 UTC