Is sending XHTML as text/html harmful?

All style (template, theme and imageset) related questions for the new release; advice, feedback here please.
User avatar
Highway of Life
Registered User
Posts: 1399
Joined: Tue Feb 08, 2005 10:18 pm
Location: I'd love to change the World, but they won't give me the Source Code
Contact:

Re: Is sending XHTML as text/html harmful?

Post by Highway of Life »

Wow, there is someone who never wants to worry about progress with the web.
So they just make up their own reasons why it would be bad to use XHTML, and call themselves brilliant. :roll:

I think I’m going to stick with XHTML 1.0, since my demographic consists of users who are tech-savvy (Firefox 2, 3, IE 6 & 7, Wii, Opera 8+, etc), not users who have IE 4 and Netscape 3.
Last edited by Highway of Life on Tue Mar 20, 2007 8:21 pm, edited 2 times in total.
Image

link92
Registered User
Posts: 46
Joined: Sat Mar 27, 2004 2:43 pm
Location: In front of my Computer
Contact:

Re: Is sending XHTML as text/html harmful?

Post by link92 »

Highway of Life wrote: Wow, there is someone who never wants to worry about progress with the web.
So they just make up their own reasons why it would be bad to use XHTML, and call themselves brilliant. :roll:

Yeah. The W3C know nothing. :roll:
Bored as hell. May as well put myself through the (X)HTML validator to see how invalid I am.

User avatar
Highway of Life
Registered User
Posts: 1399
Joined: Tue Feb 08, 2005 10:18 pm
Location: I'd love to change the World, but they won't give me the Source Code
Contact:

Re: Is sending XHTML as text/html harmful?

Post by Highway of Life »

link92 wrote: Yeah. The W3C know nothing. :roll:
I’m not referring to them, but the author of one of the HTML 4.0 articles... BTW, which was not viewable properly in a certain latest browser.
Chris wrote: I should say that IE7 will not add support for this MIME type [application/xml+xhtml]– we will, of course, continue to read XHTML when served as “text/html”, presuming it follows the HTML compatibility recommendations. We fixed the problem with our DOCTYPE switch explicitly so that this mechanism is easier to use, and it is generally easy to set up most servers to conditionally serve content as “text/html” when the “application/xml+xhtml” MIME type is not supported.
...
I made the decision to not try to support the MIME type in IE7 simply because I personally want XHTML to be successful in the long run.
As long as the pages are delivered in text/html, you’re going to be fine using XHTML, it’s not reason enough to revert back to HTML 4.0 standards, unless you really need to serve the content in another format.
Image

link92
Registered User
Posts: 46
Joined: Sat Mar 27, 2004 2:43 pm
Location: In front of my Computer
Contact:

Re: Is sending XHTML as text/html harmful?

Post by link92 »

Highway of Life wrote:
link92 wrote: Yeah. The W3C know nothing. :roll:
I’m not referring to them, but the author of one of the HTML 4.0 articles... BTW, which was not viewable properly in a certain latest browser.
Which article? All of them render as per the specs say they should be here…
Highway of Life wrote:
Chris wrote: I should say that IE7 will not add support for this MIME type [application/xml+xhtml]– we will, of course, continue to read XHTML when served as “text/html”, presuming it follows the HTML compatibility recommendations. We fixed the problem with our DOCTYPE switch explicitly so that this mechanism is easier to use, and it is generally easy to set up most servers to conditionally serve content as “text/html” when the “application/xml+xhtml” MIME type is not supported.
...
I made the decision to not try to support the MIME type in IE7 simply because I personally want XHTML to be successful in the long run.
As long as the pages are delivered in text/html, you’re going to be fine using XHTML, it’s not reason enough to revert back to HTML 4.0 standards, unless you really need to serve the content in another format.

You are relying on the UA being broken serving XHTML as text/html. Any UA that actually follows the spec will treat the solidus as a NET (as per the SGML spec). As I've already questioned, XHTML as text/html brings no advantages over HTML as text/html, only the disadvantage of relying on UAs breaking the spec.
Bored as hell. May as well put myself through the (X)HTML validator to see how invalid I am.

User avatar
SHS`
Registered User
Posts: 1628
Joined: Wed Jul 04, 2001 9:13 am
Location: The Boonies, Hong Kong
Contact:

Re: Is sending XHTML as text/html harmful?

Post by SHS` »

link92 wrote: Let me ask this one question: what advantages are there to sending XHTML as text/html over HTML as text/html?


Simple, mixed mode (ie: multiple namespaces... XHTML+SVG+MathML) XML documents. ;)

http://lambcutlet.org/files/test-cases/ ... thml.xhtml
Jonathan “SHS`” Stanley • 史德信
phpBB™ 3.1.x, Bug/Security trackers
phpBB™ Bertie Bear 3.0 — prosilver Edition!Asking Questions The Smart Way

link92
Registered User
Posts: 46
Joined: Sat Mar 27, 2004 2:43 pm
Location: In front of my Computer
Contact:

Re: Is sending XHTML as text/html harmful?

Post by link92 »

SHS` wrote:
link92 wrote: Let me ask this one question: what advantages are there to sending XHTML as text/html over HTML as text/html?


Simple, mixed mode (ie: multiple namespaces... XHTML+SVG+MathML) XML documents. ;)

http://lambcutlet.org/files/test-cases/ ... thml.xhtml

That needs to be sent as XML though, so that isn't an advantage for XHTML as text/html!
Bored as hell. May as well put myself through the (X)HTML validator to see how invalid I am.

User avatar
jojobarjo32
Registered User
Posts: 164
Joined: Wed Jun 22, 2005 7:38 pm
Location: France

Re: Is sending XHTML as text/html harmful?

Post by jojobarjo32 »

Code: Select all

<!--[if IE]>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<![endif]-->
<!--[if !IE]><-->
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
<!--><![endif]-->
Isn't that code a good solution ? :oops:

link92
Registered User
Posts: 46
Joined: Sat Mar 27, 2004 2:43 pm
Location: In front of my Computer
Contact:

Re: Is sending XHTML as text/html harmful?

Post by link92 »

No, there are other UAs that don't support application/xhtml+xml (the next biggest after IE is GoogleBot). Also, even though in theory <meta> elements should be read by the server, no server does so.

The real issue with XHTML as text/html persists even with that – it's just being parsed as malformed HTML, and any compliant UA would cause all kinds of chaos with null end tags (eg. <p/test/ is the same as <p>test</p>, therefore <img src="img1.gif" /><img src="img2.gif" /> is the same as <img src="img1.gif" >><img src="img2.gif"></img>>).
Bored as hell. May as well put myself through the (X)HTML validator to see how invalid I am.

Post Reply