<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Robertdot, A Web Design Blog &#187; Mime-Type</title>
	<atom:link href="http://robertdot.org/tags/mime-type/feed/" rel="self" type="application/rss+xml" />
	<link>http://robertdot.org</link>
	<description>A web design blog for designers that develop or developers that design.</description>
	<lastBuildDate>Tue, 25 Jan 2011 20:43:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Great MIME-Type Swindle</title>
		<link>http://robertdot.org/2006/11/19/the-great-mime-type-swindle/</link>
		<comments>http://robertdot.org/2006/11/19/the-great-mime-type-swindle/#comments</comments>
		<pubDate>Sun, 19 Nov 2006 22:06:51 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Browser Support]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Mime-Type]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://robertdot.org/2006/11/19/the-great-mime-type-swindle/</guid>
		<description><![CDATA[
 It&#8217;s a really old subject, but I haven&#8217;t said my piece on the XHTML 1.0 versus HTML 4.01 debate.  While commenting on Roger Johansson&#8217;s blog, 456 Berea Street, I said a little bit about what I think.  I figured I ought to go ahead and say my fill.


 XHTML was supposed to [...]]]></description>
			<content:encoded><![CDATA[<p>
 It&#8217;s a really old subject, but I haven&#8217;t said my piece on the <abbr title="Extensible HyperText Markup Language">XHTML</abbr> 1.0 versus <abbr title="HyperText Markup Language">HTML</abbr> 4.01 debate.  While commenting on Roger Johansson&#8217;s blog, 456 Berea Street, I said a little bit about what I think.  I figured I ought to go ahead and say my fill.
</p>
<p>
 XHTML was supposed to be the death of HTML.  HTML 4.01, <a href="http://dig.csail.mit.edu/breadcrumbs/node/166">until recently</a>, was supposed to be the last iteration of HTML.  I think XHTML is great.  It allows the designer to implement bits of <abbr title="Extensible Markup Language">XML</abbr>, should he want to.  It also is very strict, <a href="http://www.w3.org/TR/xhtml1/#diffs">requiring proper syntax where HTML didn&#8217;t</a>.  If there is something wrong with the code, the page should not render at all.  This makes good syntax coding a requirement rather than a suggestion.  However, the current implementation of most of the XHTML pages I know of is ideologically broken.  The rest don&#8217;t work on Internet Explorer.
</p>
<p>
 The <a href="http://www.456bereastreet.com/archive/200611/have_your_say_about_the_future_of_html/#comment14" rel="nofollow">comments</a> <a href="http://www.456bereastreet.com/archive/200611/have_your_say_about_the_future_of_html/#comment30" rel="nofollow">I made</a> assumed a little foreknowledge but basically say what I want to say here.  However, I&#8217;ll go ahead and lay out my full argument here.
</p>
<p>
 In 2000 when XHTML 1.0 was introduced, there was a need for backward compatibility since most browsers could not render real XHTML.  That is, browsers were built to render HTML served as <code>text/html</code>.  Sending XHTML as XML resulted in, I assume, an interpreted XML tree.  So that adoption of XHTML would occur, it needed to work in browsers.  So, the XHTML recommendation had <a href="http://www.w3.org/TR/xhtml1/#guidelines">guidelines</a> in place of how to make XHTML work on HTML browsers.  This wasn&#8217;t backward compatibility so much as a hack.  It didn&#8217;t allow for any of the benefits of XHTML, though it succeeded in making pages written with XHTML syntax render on old browsers.  So, the mime-type is the modern equivalent of <code>DOCTYPE</code> triggering quirksmode (which <a href="http://blog.whatwg.org/html-vs-xhtml">the Web Hypertext Application Technology Work Group embrace</a>).
</p>
<p>
 As far as hacks go, it worked.  Like all <q>transitional</q> solutions, it was supposed to be dropped as browser support for XHTML grew.  The problem is that Internet Explorer never supported it (<a href="http://blogs.msdn.com/ie/archive/2005/09/15/467901.aspx">even in version 7</a>) and people opted to continue to send HTML-XHTML.  Further, it seems, many people don&#8217;t realize that real XHTML requires the correct <code>application/xhtml+xml</code> mime-type being sent.  This is something that must be set up on the server, as <code>text/html</code> is the default mime-type for sending <code>.html</code> documents on every web server I know of.
</p>
<p>
 When XHTML is sent as <code>text/html</code>, it <a href="http://www.webdevout.net/articles/beware_of_xhtml.php#content_type">behaves differently</a> than if it is sent correctly.  XHTML sent as HTML is treated as tag soup, which means any optimized, light weight XML parsers aren&#8217;t used.  Tag Soup XHTML doesn&#8217;t require strict use of <code>CDATA</code> elements and improper syntax doesn&#8217;t stop rendering of the page.  The null closing tags are treated as broken attributes.  While it still works, XHTML is ideologically broken if it is sent as <code>text/html</code>.  People who suggest we ought to use XHTML to guarantee that fledgling designers pick up XHTML (which would require strict syntax) are suggesting that we use a broken implementation to uphold an ideal that is at odds with broken implementations (ignoring that an unforgiving markup language would cause most designers to give up out of irritation).  It is hypocritical.
</p>
<p>
 So, I see two choices that are ideologically sound.  The first is to use XHTML and send it as <code>application/xhtml+xml</code>, Internet Explorer be damned.  However, this is really not a good choice for most.  Some would suggest <a href="http://www.webstandards.org/learn/articles/askw3c/sep2003/">content negotiation</a>, but this is still a hack that requires <a href="http://www.456bereastreet.com/archive/200501/the_perils_of_using_xhtml_properly/">a lot of extra thinking and planning</a> (albeit a better one than sending XHTML as HTML).  The second is to only use XHTML in specific instances where compatibility can be guaranteed.
</p>
<p>
 Let me elaborate on the second choice.  HTML 4.01 is a web standard.  Anyone in the web standards group that always advocates XHTML over HTML on grounds that XHTML is better suited for use than HTML doesn&#8217;t understand what tools are for.  HTML with a strict <code>DOCTYPE</code> can be validated, written semantically, and obsessed over as much as XHTML.  HTML just allows the web designer to make the choice (and good designers will obsess over their markup no matter what).
</p>
<p>
 HTML and XHTML are tools to solve a problem.  Just like a screwdriver won&#8217;t help when a hammer is needed, XHTML is no good when HTML is needed.  I&#8217;ll be specific.  On pages where free-form user input is allowed, the potential for non-designers (and designers, too, for that matter) to enter bad markup is huge.  In a real XHTML page, the user could <a href="http://diveintomark.org/archives/2004/01/14/thought_experiment">easily break a page</a>, preventing rendering.  When using HTML, the page may no longer validate, but it will still render.  In instances such as these HTML is a better tool than XHTML.
</p>
<p>
 Web applications, however, are a different story.  System requirements can be specified as they are on traditional applications (e.g. a browser that supports XHTML can be required).  This means that no hacks need to be used.  Since web applications generally use form elements to display and edit data, concerns over user input are drastically reduced.  Most of the time, discreet data is required rather than free-flow data that one might find on, say, a comments page.  So, data can be more accurately validated.  When that data is inserted into an XHTML page, it&#8217;s far less likely to break the page.  On a syntactical level, XHTML meshes well with programming languages.  That is, the code must live up to certain standards.  XHTML would help tie the front end to the back end.  XHTML is a perfect tool for web applications.
</p>
<p>
 So, ignoring all the common arguments about the dangers of using XHTML, the ideology of XHTML is broken if the page works in Internet Explorer 7 or below.  Advocating the use of a broken technology is hypocritical when well written HTML 4.01 with a strict <code>DOCTYPE</code> is better suited for normal web usage.  However, XHTML has a defined and useful place on the World Wide Web.
</p>
<p>
 If you want another opinion, Maciej Stachowiak of Apple&#8217;s WebKit / Safari project weighs in with <a href="http://webkit.org/blog/?p=68">pretty much the same opinions I have</a>.
</p>
<p>
 <strong>Update:</strong> <em>The</em> <a href="http://lachy.id.au/">Lachlan Hunt</a> pointed out that I screwed up the XHTML MIME-type.  I fixed the error.</p>
]]></content:encoded>
			<wfw:commentRss>http://robertdot.org/2006/11/19/the-great-mime-type-swindle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

