Why your XHTML article is wrong

> It is suggested that authors should use HTML 4.01 instead of XHTML 
> [...]

XHTML is simpler, more aesthetically pleasing, and works with deployed 
XML and HTML tools and specs (like namespaces). I see no reason not to 
use it now.

> you are [...] relying on their error handling.

I don't see why this is bad. Relying on such slack is how we can build 
backwards-compatible specs; otherwise upgrading would require a flag 
day.

>  * <script> and <style> elements

I don't use any.

>  * Document sent as text/html are handled as tag soup [2] by most UAs.
>    This means that authors are not checking for validity,

That doesn't follow.

> the main advantage of using XHTML [is] that it has to be valid

That's pretty subjective; I don't consider that the main advantage.

>  * If you ever switch your XHTML documents from text/html to text/xml,
>    then you will in all likelyhood end up with a considerable number
>    of XML errors, meaning your content won't be readable by users.
>    (Most XHTML documents do not validate.)

Sure, invalid documents are invalid. What does this have to do with 
XHTML?

>  * A CSS stylesheet written for an HTML document has subtly different
>    semantics [...]

I don't take advantage of these.

>  * A script [...]

ditto

>  * The only real advantage to using XHTML rather than HTML is that it
>    is then possible to use XML tools with it. However, if tools are
>    being used, then the same tools might as well produce HTML for you.
>    Alternatively, the tools could take SGML as input instead of XML.

And tools could parse and produce TeX too. By your reasoning, it'd be 
safe for the Web to move to TeX.

>  * HTML 4.01 contains everything that XHTML contains,

HTML 4.01 doesn't allow namespaces.

>  so there is little reason to use XHTML in the real world.

Even if the premise was true, that doesn't follow.

> UAs can't handle XHTML sent as text/html as XML

I agree with this, and I'd like to hear suggestions on how to address 
this problem. I have no problem sending my content with a special mime 
type to a client which will do the right thing with it, do you have 
code that will do this for me?

Kluge: I've set up http://xhtml.aaronsw.com/ to be identical to 
aaronsw.com except serve pages with an XHTML mime type. Doing this 
found a few problems, as your article suggests it would. It also found 
a Mozilla bug:

Test case: http://www.aaronsw.com/2002/fixedxmlns

Do you want to file a bug?

> There are few advantages to using XHTML if you are sending the content
> as text/html, and many disadvantages.

You have not listed one disadvantage.

> Authors should stick to writing valid HTML 4.01 for the time being.
> Once user agents that support XML and XHTML sent as text/xml are
> widespread, then authors may reconsider learning and using XHTML.

This makes no sense. We know that we will have to rewrite HTML pages to 
be XHTML. We know how to do this. Why should we not do that now, 
creating less work for later?

-- 
Aaron Swartz [http://www.aaronsw.com]

Received on Tuesday, 19 November 2002 23:00:10 UTC