Re: Is this legal XHTML 1.1?

On Fri, 13 Dec 2002, Christian Wolfgang Hujer wrote:
> Am Freitag, 13. Dezember 2002 06:38 schrieb Ian Hickson:
>> Please point out the exact step where you think there is a logic error:
>>
>>    Most authors only check their documents using one or two UAs,
>>    rather than using a validator.
>
> Yes, but *that* group usually even does not know of either W3C or XHTML.

They may not know of either, but they are using XHTML because everyone
else is using XHTML now. Authors write by copying and pasting.

Just take a look at the insanely hight percentage of new pages being
writen that have XHTML DOCTYPEs.


>>    Ergo these authors are not checking for validity.
> Yes. They should be teached validity first, then XHTML.

Good luck with that.

The much more realistic solution is not to get them on XHTML at all, and
the way to do that is by not using it in the first place, so that they
copy HTML and not XHTML.


>>    Most authors (including me) occasionally include at least one error in
>>    their documents, making them ill-formed.
> Well, the only "error" I occasionally include is namespace declarations that 
> should not be there because some XSLT processors have some really annoying 
> (but still absolutely correct) behaviour about namespace declarations.

You never write documents that don't validate?


> But usually all my XHTML documents are, and all my HTML documents were valid.
> I check each document for validity *before* upload, even before locally 
> viewing them in the browsers.

And you never find them invalid when you are writing them?


>>    Ergo the authors that are a cross-section of both groops, and use
>>    XHTML, are placing invalid XHTML documents on the web.
> That's true.

And that is the problem!


>> Since the two groups are huge proportions of the Web authoring community,
>> as a quick perusal of XHTML sites will show,most XHTML documents on the
>> web now are invalid.
>>
>> Where is the error?
>
> But that is not a reason not to use XHTML

I'm not saying "don't use XHTML". I'm saying "don't send XHTML as
text/html", for the good of the Web and for your future sanity.


> If someone uses XHTML instead of HTML, always serves it as text/html,
> and even uses invalid XHTML, nothing has changed from the past.

One thing _has_ changed. When they eventually switch to an XML MIME type,
those documents will be unusable.


>> This document isn't some sort of theoretical excercise. It is listing
>> practical reasons why using text/html for XHTML is bad.
> It's bad in the cases described.

Thank you.


> But what about a valid XHTML 1.1 document that displays fine even in
> Netscape 4?

Since no valid XHTML 1.1 document could ever be sent as text/html, that
will never happen.


> Why shouldn't such a document be served as .xhtml with
> application/xhtml+xml to Mozilla, Opera and all other browsers that
> send an Accept header which contains application/xhtml+xml and .html
> with text/html to the user agents that don't say they knew
> application/xhtml+xml like Internet Explorer? Those are tag soup
> anyway, they "don't know the difference".

That would be great, if people did it.

They don't. (With the exception of maybe 3 or 4 sites.)


>> One of those reasons is that 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.)
>
> See above. When I speak of XHTML I speak of validating XHTML.

When I speak of XHTML I speak of anything with an XHTML DOCTYPE, valid or
not. Shutting your eyes to the reality of the mess being created here does
no-one any good.


> Of course, many problems will arise if they have not been considered
> in the first place. HTML DOM seems not to apply to current
> implementations of application/xhtml+xml user agents, so XML DOM must
> be used. Some differences are between HTML CSS and XHTML CSS in
> current User Agents.
> 
> What if all this has been considered?

Then you are one in about 5,000,000 people. (I think that number is
actually accurate. By it I mean that you are one of about hundred people
world-wide who actually understand the problem and know how to avoid its
pitfalls.)

If you are one of those few, very few, people, then sure, go ahead, use
XHTML and send it as XML to some UAs and XHTML to others. But otherwise,
you _will_ run into those many problems I listed, and you shouldn't be
using XHTML as text/html.

My document is aimed at the general authoring public, not the extremely
rare uber-geeks of the Web world.


>> I don't know of _anyone_ who has switched or could switch from text/html
>> to an XML MIME type without a single problem.
>
> I also had my problems, but I detected them *before* I published the documents 
> on the web.

But that's not important. The point is you will hit problems, wherever you
hit them, if you try to change to a correct MIME type. If you have
1,000,000 documents, as some big sites do, then that will cost real cash.

>>> Point 6 that could be considered by the CSS author.
>> Yes, all of these points _could_ be considered. But they are not.
> They are at least of me.

You are not a typical Web author.

>>> Anyhow, both, RFC2854 and RFC3236 are informational
>>> So I can't see why you consider these two RFCs of such very high
>>> importantance.
>>
>> What else gives you any allowance to send anything as text/html or
>> application/xhtml+xml?
>
> The W3C note, which of course is just a note.

The W3C note does not define these MIME types.

Even if it did, it has no more normative standing than the two RFCs.


> We're talking of HTTP and HTML, which are the WWW part of the
> Internet. I consider the W3C's documents on WWW to have priority over
> those from the IETF. We're talking about HTML and HTTP, not about MIME
> for E-Mail or IPv6.

HTTP and MIME types are defined in RFCs, not W3C RECs.

The HTML specs do not define any MIME types.


> I still can't see why I should not serve them as application/xhtml+xml to 
> application/xhtml+xml accepting ua's and text/html to the tag soup browsers.

_You_, specifically, are an such an extreme exception that the document
doesn't even attempt to apply to you. For the few people who understand
enough of the issues to know to serve XHTML to only some UAs, I wish all
the best of luck.

But for the real world, the issues I raised are very real issues that
should be valid reasons for not using XHTML with text/html.

I'll update my document to make this clearer.

-- 
Ian Hickson                                      )\._.,--....,'``.    fL
"meow"                                          /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'

Received on Friday, 13 December 2002 02:30:04 UTC