Re: XHTML, attribute minimization, and deployed UAs

Todd Fahrner wrote:
> 
> [sorry if duplicate - first didn't seem to go through]
> 
> I hope I'm wrong about this:
> 
> XHTML documents containing formerly minimizable attributes don't work in
> current browsers.

Could well be; XHTML is written in XML. HTML (the spec) is written in
SGML and HTML (the practice) is written in, well, stuff.

> In HTML, these constructs are common:
> 
> <input checked>
> <option selected>
> <ul compact>
> <textarea wrap>   (ns extension)
> <td nowrap>       (deprecated, but needed even in IE5 since it still doesn't
>                    implement CSS1)
> 
> In XHTML, however, these must become:
> 
> <input checked="checked">
> <option selected="selected">
> <ul compact="compact">
> <textarea wrap="wrap">
> <td nowrap="nowrap">

Correct. Other undersirable SGML-isms eliminated from XML include
optional quotes on attributes, sometimes-optional closing semicolons on
entities, omissible end tags, omissible start tags, and only being able
to tell if an element is empty by reading the dtd.

That means that any XML parser will produce the same parse tree, and it
means that the DOM has some chance of producing consistent results, and
that CSS has some chance of working because, after all, contextual
selectors are only going to work if the context (ie the parse tree, in
particular the stack of open elements) is the same in different
browsers.

> ...and in my testing with today's browsers, this syntax fails to deliver the
> hoped-for results. I've tried adding whitespace in various places (a la <br
> />) without success.

I was never convinced that writing XML and pretending that existing HTML
"parsers" would accept it was a worthwhile exercise.


> This is a real deterrent to using XHTML for, say, tables and forms:
> precisely the application where machine-generation and other powerful
> XML/DOM-based stuff is most compelling.

Not really - just serve it up as application/xml and any XML compliant,
CSS compliant application will display it. If you want powerful, XML/DOM
stuff then it stands to reason that you need to feed it to an XML
implementation, not an (undocumented rats nest of bugs) implementation.

--
Chris

Received on Sunday, 28 March 1999 17:16:12 UTC