<?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>Andrey Shchekin &#187; XHTML</title>
	<atom:link href="http://blog.ashmind.com/index.php/category/web/markup/xhtml/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ashmind.com</link>
	<description></description>
	<lastBuildDate>Mon, 15 Mar 2010 18:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>XHTML and microformats revisited</title>
		<link>http://blog.ashmind.com/2007/06/03/xhtml-and-microformats-revisited/</link>
		<comments>http://blog.ashmind.com/2007/06/03/xhtml-and-microformats-revisited/#comments</comments>
		<pubDate>Sat, 02 Jun 2007 21:26:25 +0000</pubDate>
		<dc:creator>Andrey Shchekin</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[History]]></category>
		<category><![CDATA[Markup]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[microformats]]></category>

		<guid isPermaLink="false">http://blog.ashmind.com/index.php/2007/06/03/xhtml-and-microformats-revisited/</guid>
		<description><![CDATA[Since my previous post on microformats, I have decided that my opinion in this matter needs more evidence. While I could collect all following information before writing the post, I didn&#8217;t have enough motivation to do the research. But now, after writing it, I have my self-esteem as a motivation. Ok, so I proposed using [...]]]></description>
			<content:encoded><![CDATA[<p>Since my <a href="http://blog.ashmind.com/index.php/2007/05/22/microformats-are-web-20-virus/">previous post</a> on microformats, I have decided that my opinion in this matter needs more evidence.<br />
While I could collect all following information <em>before</em> writing the post, I didn&#8217;t have enough motivation to do the research.<br />
But now, <em>after</em> writing it, I have my self-esteem as a motivation.</p>
<p>Ok, so I proposed using (namespaced) custom tags instead of overloading existing ones.<br />
Now let&#8217;s go scientific and see what questions this solution may rise.</p>
<ol>
<li>Do modern browsers support CSS styling for unknown tags in HTML documents?</li>
<li>Can these tags be added to document without breaking standard compliance (validity)?</li>
<li>What possible problems can arise from using non-standard tags in modern browsers?</li>
<li>&#8230;</li>
</ol>
<p>For practical purposes, these can be converted into two main questions</p>
<ol>
<li><em>Should</em> custom tags work?</li>
<li><em>Do</em> custom tags work in modern browsers?</li>
</ol>
<p>And the answers are:</p>
<ol>
<li>By default, no.</li>
<li>Not perfectly, but yes.</li>
</ol>
<p>Now let&#8217;s discuss it in detail.</p>
<p>To understand the first answer is to understand what exactly is HTML, what is XML and what is XHTML.<br />
The most important (maybe obvious) point is: HTML is not a subset of XML and HTML is not compatible with XML.<br />
HTML and XML are both a subsets of SGML, and SGML does not provide a way to mix different subsets within a single document.<br />
So custom XML tags are not allowed in a HTML document.</p>
<p>While there are some solutions that allow arbitrary XML to be placed in a HTML document.<br />
For example, Microsoft has <a href="http://msdn2.microsoft.com/en-us/library/ms766512.aspx">XML Data Islands</a>.<br />
But they can be considered grammar hacks due to XML-HTML incompatibility.</p>
<p>Practically, however, HTML documents have to be viewed as &#8220;tag soup&#8221; by the browsers, so custom tags do not cause document rendering to fail.</p>
<p>So, if I am formally out of luck with HTML, what about XHTML?<br />
For simplicity, one can view XHTML is a rewrite of HTML to follow XML rules.<br />
So any custom tags should be allowed in XHTML if they are properly namespaced.</p>
<p>But there are a lot of problems with authoring XHTML.<br />
While some of them are more like challenges (script/style syntax), one is extremely important.<br />
The only way to tell modern browsers that that the document is XHTML is to serve it as application/xhtml+xml<br />
(See <a href="http://www.hixie.ch/advocacy/xhtml">this document</a> for an excellent explanation).<br />
And Internet Explorer <a href="http://blogs.msdn.com/ie/archive/2005/09/15/467901.aspx">doesn&#8217;t support XHTML</a> at all — so it refuses to render application/xhtml+xml.<br />
(It doesn&#8217;t mean IE can&#8217;t open XHTML. When XHTML document is sent as text/html, IE renders it with HTML engine).<br />
So I was out of luck once again.</p>
<p>At that point I understood the reasoning of microformats.<br />
Standard compliance is an important part of better Web, and there is no completely valid way to use custom tags.</p>
<p>But what is with the second question? It seems that actual situation is way better than one could suppose.<br />
Firefox, IE7 and Opera 9 all could render the custom tags style correctly in the document served as text/html.<br />
(To be really pedantic, I set DTD and xmlns to XHTML.<br />
After all, even if text/html documents are never parsed as XHTML, MIME Type is a server setting, not document one.)<br />
But IE7 has a one important characteristic — it does not render custom tag styles unless there is an xmlns for their namespace on html tag.<br />
No other tag is sufficient.</p>
<p>What does it mean? It means that while one can make a document that is styled correctly in these IE7,<br />
document part containing custom tags can not be reused without providing a namespace on the aggregating document.<br />
But it not an extremely important point, since for aggreagation one does not actually control styles as well.</p>
<p>So, practically speaking, one can create a document that uses custom XML tags for the cost of formal document validity.<br />
(The document can still be made formally valid by using custom DTD, but this will put IE and FF into <a href="http://www.quirksmode.org/">quirks mode</a>).</p>
<p>By the way, the challenge of adding custom tags to HTML was faced by MathML (mathematical markup language) community for years.<br />
If you are interested, you can read these discussions:</p>
<ul>
<li><a href="http://groups.google.ru/group/netscape.public.mozilla.mathml/browse_frm/thread/3c8bf8b155267234">Cannot render MathML — netscape.public.mozilla.mathml</a> (2001)</li>
<li><a href="http://groups.google.com/group/mozilla.dev.tech.mathml/browse_thread/thread/796fad03fdd4fc59/2b6952b15cd6a7d6">MathML-in-HTML5 — mozilla.dev.tech.mathml</a> (2006)</li>
</ul>
<p>Personally, I still see microformats as a step in wrong direction.<br />
While hCard provides HTML with a way to express the vCard semantics, I would prefer it to be just a HTML-compatible way, not the recommended one.<br />
I see HTML as standard that needs support, but not popularized extensions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ashmind.com/2007/06/03/xhtml-and-microformats-revisited/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
