Talk:XHTML

I think this should really have a "why not use it" section; there's no need to use XHTML unless you need ruby or an extension such as MathML. Porges 22:22, 1 Apr 2005 (PST)


 * That's hardly a reason to not use XHTML. It's a reason why it might not be necessary, but not a reason to avoid it. I can't think of a single disadvantage to using XHTML over HTML 4.1. -- kchrist 07:07, 2 Apr 2005 (PST)

Simon Jessey: There are many reasons for using XHTML that may not be immediately obvious. For example, an XHTML document can be scraped to create a feed, or transformed with XSLT to suit another purpose. The document can be used in ways the original author may not have intended.

Maybe I was just worried about the "Why use XHTML" section as it is a little misleading...
 * "It forces you to write correct markup, which means your pages have much more consistent results in browsers across the spectrum; even your grandma's crusty old version of Netscape!"
 * It doesn't force you to write correct markup, unless you serve it as application/xhtml+xml, which doesn't work in IE.


 * Your pages will load faster when you use valid markup, because the browser doesn't have to stop to try and figure out what you meant
 * You can write (almost) the exact same markup in HTML 4.01 - furthermore, if served as application/xhtml+xml, Mozilla et al won't have incremental rendering of the page.


 * Tired of writing a specialized version of your site for text-only viewers, wireless viewers, and so on? Don't! With XHTML, you can write once, be viewed by all!
 * Again, you can write (almost) the exact same markup in HTML 4.01.


 * Particularly with XHTML Strict, XHTML helps force you to separate your "structure" (content) from your "presentation" (colours, fonts, margins, etc... all the stuff that should be going into your CSS files). This leads to much cleaner designs, as well as increased accessibility.
 * Again, it doesn't "force" you, and you can accomplish the same goal in HTML 4.01.

Just to note, I'm all for XHTML, it's just that all this "USE XHTML IT'S BETTER" with no qualifications is getting on my nerves :) Porges 15:02, 4 Apr 2005 (PDT)

snarkles My fault. :) It was late (I even wrote eXtensible instead of Extensible, d'oh!), and I was trying to write something in sort of a humourous fashion (kind of the "Dreamhost" way--I came for the great deals on hosting packages, but I stay for the monthly newsletters ;)). Feel free to tweak if you want, and/or even remove that section altogether.

Ok, I'll have a go at rewriting it. I just think that encouraging people to use XHTML without a bit more guidance/warnings will end up creating hybrid monstrosities such as the EAPlay site :) Porges 15:53, 4 Apr 2005 (PDT)

EAPlay.com Validation Result with forced Doctype.

"This Page Tentatively Validates As XHTML 1.0 Transitional (Tentatively Valid)!"

So Porges, on the topic of un-qualified statements.. perhaps you yourself could explain how eaplay.com is a "hybrid monstrosity" and how a lack of guidance/warning in the use of XHTML has made it that way.


 * To whoever wrote that comment: at the time of writing, the page was... it seems to have been tweaked since then :) Porges 17:13, 2 May 2005 (PDT)

Also,
 * "It forces you to write correct markup, which means your pages have much more consistent results in browsers across the spectrum; even your grandma's crusty old version of Netscape!"
 * It doesn't force you to write correct markup, unless you serve it as application/xhtml+xml, which doesn't work in IE.

Serving the page with the 'correct' mime type is neither here, nor there. The goal is "consistent results in browsers across the spectrum". JB 16:30, 27 Apr 2005 (PDT)

Actually, the goal of XHTML is to offer an extensible version of HTML that is based upon XML, so that authors can take advantage of other namespaces, and users can repurpose documents in ways the author may never have considered. A strict adherence to the rules, and separation of the content from its presentation and behavior makes this possible. It has nothing to do with cross-browser consistency. -- Scjessey 05:25, 27 Apr 2005 (PDT)

I was obviously refering to one of the suggested "reasons why modern websites are beginning more and more to move toward XHTML". I am not saying XHTML was created for cross-browser consistency. But, like it or not, repurposing documents is not the only reason for using XHTML. A few other reasons I can think of are readability, lower file sizes, 'future proofing' and debugging pages against the XHTML validator.--JB 03:04, 28 Apr 2005 (PDT)

XHTML 1.1 detail added
I have added a section on how to force the application/xhtml+xml MIME type for XHTML 1.1 pages, both for static pages and PHP / dynamic pages. Dhvrm 20:23, 6 April 2008 (PDT)


 * Of course this will mean that many browsers will be unable to serve the content because they don't support the MIME type. JavaScript using  will also be broken. -- Scjessey 06:35, 7 April 2008 (PDT)