This link has been bookmarked by 67 people . It was first bookmarked on 24 Apr 2006, by kay.
-
19 Oct 14
-
06 Jun 14
-
13 Aug 13
-
06 Aug 12
Christian Johansen"Sending XHTML as text/html Considered Harmful"
-
20 Oct 10
-
11 Aug 10
-
24 Feb 10
-
01 Jan 10
-
29 Dec 09
-
22 Oct 09
-
[1] The term "handled as tag soup" refers to the fact that browsers typically are very lenient in their error handling, and do not support any of the "advanced" SGML features. For example, browsers treat the string "<br/>" as "<br>" and not "<br>>", the latter being what HTML4/SGML says they should do.
-
[1] The term "handled as tag soup" refers to the fact that browsers typically are very lenient in their error handling, and do not support any of the "advanced" SGML features. For example, browsers treat the string "<br/>" as "<br>" and not "<br>>", the latter being what HTML4/SGML says they should do.
-
This document is somewhat out of date, and has been somewhat overtaken by events, though the core message (don't send XML as text/html) still holds. My recommendation now would be to just use HTML5; it's simpler to use (e.g. the DOCTYPE is just "<!DOCTYPE HTML>"), it has allows XML-like syntax in the same places that XHTML 1.0 Appendix C did (e.g. you can say <br/> instead of just <br>), and it has well-defined processing rules, unlike earlier versions of HTML and XHTML.
-
This document is somewhat out of date, and has been somewhat overtaken by events, though the core message (don't send XML as text/html) still holds.
-
Why using text/html for XHTML is bad ------------------------------------ What usually happens to authors who decide to send XHTML as text/html is the following: 1. Authors write XHTML that makes assumptions that are only valid for tag soup or HTML4 browsers, and not XHTML browsers, and send it as text/html. (The common assumptions are listed below.) 2. Authors find everything works fine. 3. Time passes. 4. Author decides to send the same content as application/xhtml+xml, because it is, after all, XHTML. 5. Author finds site breaks horribly. (See below for a list of reasons why.) 6. Author blames XHTML.
-
* If a user saves such an text/html document to disk and later reopens it locally, triggering the content type sniffing code since filesystems typically do not include file type information, the document could be reopened as XML, potentially resulting in validation errors, parsing differences, or styling differences.
-
* The only real advantage to using XHTML rather than HTML4 is that it is then possible to use XML tools with it.
-
* HTML 4.01 contains everything that XHTML 1.0 contains, so there is little reason to use XHTML in the real world. It appears the main reason is simply "jumping on the bandwagon" of using the latest and (perceived) greatest thing.
-
The Myth of "HTML-compatible XHTML 1.0 documents" ------------------------------------------------- RFC 2854 spec refers to "a profile of use of XHTML which is compatible with HTML 4.01". There is no such thing. Documents that follow the guidelines in appendix C are not valid HTML 4.01 documents. They just happen to be close enough that tag soup parsers are able to handle them just like most of the other pages on the Web.
-
conforming XML browser would thus be unable to show as many documents as current browsers, and would therefore never get enough marketshare to be relevant.
-
* Even if you could detect XHTML, what do you do with a document that is not well formed (such as the example above)? If you fall back on HTML4, then there is no advantage to using an XML processor, and you might as well always treat it as HTML4.
-
The advantages of XHTML ----------------------- When sent as application/xhtml+xml, XHTML has several advantages: 1. XHTML content will be able to be mixed-and-matched with content from other well-known namespaces (in particular, MathML). This is the main advantage for content authors. 2. Browsers will immediately catch well-formedness errors (though other errors still won't be caught). 3. Tools interacting with XHTML documents are guaranteed a well-formed document. However, none of these apply when an XHTML document is sent as text/html, and since authors feel their pages should be readable on the most popular Web browser, which does not support application/xhtml+xml, there is basically no point in using XHTML at the moment.
-
Note: Sending XHTML 1.1 as text/html is NEVER fine. There is no spec that allows this. Sending XHTML 2.0 as anything in a production (non-testing) context is NEVER fine either, since that spec has not reached CR yet.
-
[1] The term "handled as tag soup" refers to the fact that browsers typically are very lenient in their error handling, and do not support any of the "advanced" SGML features.
-
-
24 Sep 09
-
30 Aug 09
Fabien CadetA number of problems resulting from the use of the text/html MIME type in conjunction with XHTML content are discussed. It is suggested that XHTML delivered as text/html is broken and XHTML delivered as text/xml is risky, so authors intending their work for public consumption should stick to HTML 4.01, and authors who wish to use XHTML should deliver their markup as application/xhtml+xml.
-
09 Jul 09
-
01 Jul 09
-
22 Apr 09
-
15 Jan 09
-
07 Jan 09
-
13 Oct 08
Xavier BadosaAuthor: Ian Hickson <ian@hixie.ch>
A number of problems resulting from the use of the text/html MIME type in conjunction with XHTML content are discussed. It is suggested that XHTML delivered as text/html is broken and XHTML delivered as text/xml is risky -
10 Oct 08
-
08 Oct 08
-
16 Sep 08
-
05 Aug 08
Jessica Vázquezapplication/xhtml+xml
webdesign webdev standards programming html javascript development design xml xhtml webstandards webdevelopment web w3c
-
31 Jul 08
-
12 Jul 08
-
28 May 08
-
27 May 08
-
27 Mar 08
-
19 Feb 08
-
01 Jan 08
-
20 Dec 07
-
13 Sep 07
-
25 Jul 07
-
08 Mar 07
-
12 Feb 07
-
24 Nov 06
-
02 Nov 06
-
24 Oct 06
-
12 Oct 06
segnalazioniPerche` non usare xhtml e servirlo come text/html
-
17 Jul 06
GKW LauA number of problems resulting from the use of the text/html MIME type
in conjunction with XHTML content are discussed. It is suggested that
XHTML delivered as text/html is broken and XHTML delivered as text/xml
is risky, so authors intending their wor -
31 May 06
-
02 Apr 05
-
18 Feb 05
David CorkingWhy we still can't use XHTML on the web, and should use HTML 4.01 instead. Note: this is very sad.
See Appendix B for the way out.-
Unfortunately, IE6 does not support application/xhtml+xml (in fact, it does not support XHTML at all)... Some advanced authors are able to send back XHTML as application/xhtml+xml to UAs that support it, and as text/html to legacy UAs.
-
-
24 Nov 04
-
23 Oct 04
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.