<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: XHTML vs HTML</title>
	<atom:link href="http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/feed/" rel="self" type="application/rss+xml" />
	<link>http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/</link>
	<description>So I don't have to figure things out more than once.</description>
	<pubDate>Thu, 28 Aug 2008 09:42:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: Mark Rowe</title>
		<link>http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-14</link>
		<dc:creator>Mark Rowe</dc:creator>
		<pubDate>Thu, 05 Oct 2006 00:57:57 +0000</pubDate>
		<guid isPermaLink="false">http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-14</guid>
		<description>&lt;p&gt;Rob, the validator doesn't let the forward slash go.  It parses the HTML document according to the HTML standard, which mandates using the SGML rules for tag parsing.  If you take a look at the parse tree produced from the W3C validator for &lt;a href='http://bdash.net.nz/files/valid-html-4-01-strict.html'&gt;a "Valid HTML 4.01 Strict" document&lt;/a&gt; and compare it to how web browsers render it you will notice that they disagree with how the forward slash as part of attributes is handled.  Web browsers ignore it in order to allow "HTML-compatible" XHTML to be parsed correctly, while the W3C Validator treats the forward slash as the end of the tag and everything after it becomes &lt;em&gt;contents&lt;/em&gt; of the element.  The "HTML-compatible" XHTML relies on this non-standard handling of forward slashes in browser.  If the W3C validator had been updated as you claim, the issue with the extra "&#62;" at the end of &#60;img /&#62; that Robert Marshall notes in the first comment would not exist.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Rob, the validator doesn&#8217;t let the forward slash go.  It parses the HTML document according to the HTML standard, which mandates using the SGML rules for tag parsing.  If you take a look at the parse tree produced from the W3C validator for <a href='http://bdash.net.nz/files/valid-html-4-01-strict.html'>a &#8220;Valid HTML 4.01 Strict&#8221; document</a> and compare it to how web browsers render it you will notice that they disagree with how the forward slash as part of attributes is handled.  Web browsers ignore it in order to allow &#8220;HTML-compatible&#8221; XHTML to be parsed correctly, while the W3C Validator treats the forward slash as the end of the tag and everything after it becomes <em>contents</em> of the element.  The &#8220;HTML-compatible&#8221; XHTML relies on this non-standard handling of forward slashes in browser.  If the W3C validator had been updated as you claim, the issue with the extra &#8220;&gt;&#8221; at the end of &lt;img /&gt; that Robert Marshall notes in the first comment would not exist.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Trey</title>
		<link>http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-13</link>
		<dc:creator>Trey</dc:creator>
		<pubDate>Wed, 04 Oct 2006 23:11:11 +0000</pubDate>
		<guid isPermaLink="false">http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-13</guid>
		<description>&lt;p&gt;What I mean is that if you're going to use the "best" markup, it should be strict--whether X or not.  I officially don't care about the issue of X or not, as long as it's strict.  Presentational markup is for squares.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>What I mean is that if you&#8217;re going to use the &#8220;best&#8221; markup, it should be strict&#8211;whether X or not.  I officially don&#8217;t care about the issue of X or not, as long as it&#8217;s strict.  Presentational markup is for squares.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Burns</title>
		<link>http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-12</link>
		<dc:creator>Rob Burns</dc:creator>
		<pubDate>Wed, 04 Oct 2006 22:27:01 +0000</pubDate>
		<guid isPermaLink="false">http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-12</guid>
		<description>&lt;p&gt;@Trey&lt;/p&gt;

&lt;p&gt;The validator lets the slash "/" go because they have been updated to be aware of the XHTML syntax. The issue is all overblown FUD. It doesn't matter whether the doctype is strict or transitional. It is part of W3C recommendations to serve XHTML as mime type text/html.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Trey</p>

<p>The validator lets the slash &#8220;/&#8221; go because they have been updated to be aware of the XHTML syntax. The issue is all overblown FUD. It doesn&#8217;t matter whether the doctype is strict or transitional. It is part of W3C recommendations to serve XHTML as mime type text/html.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Trey</title>
		<link>http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-11</link>
		<dc:creator>Trey</dc:creator>
		<pubDate>Tue, 03 Oct 2006 05:36:01 +0000</pubDate>
		<guid isPermaLink="false">http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-11</guid>
		<description>&lt;p&gt;But in any realistic use, it doesn't matter.  Nobody writes markup like that, do they?  I understand what you're saying, but that kind of thing is unlikely to matter if the person writing the markup has any sense at all.&lt;/p&gt;

&lt;p&gt;And again I come to the same conclusion that I've had for quite some time:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It doesn't matter as long as you use a strict doctype.&lt;/strong&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>But in any realistic use, it doesn&#8217;t matter.  Nobody writes markup like that, do they?  I understand what you&#8217;re saying, but that kind of thing is unlikely to matter if the person writing the markup has any sense at all.</p>

<p>And again I come to the same conclusion that I&#8217;ve had for quite some time:</p>

<p><strong>It doesn&#8217;t matter as long as you use a strict doctype.</strong></p>]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Rowe</title>
		<link>http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-10</link>
		<dc:creator>Mark Rowe</dc:creator>
		<pubDate>Tue, 03 Oct 2006 00:42:22 +0000</pubDate>
		<guid isPermaLink="false">http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-10</guid>
		<description>&lt;p&gt;Try validating the following HTML document in the W3C validator with the "Show parse tree" option enabled.  It shows that it parses everything after the forward-slash as being the content of the tag.  This explains the extra &#62; that Robert Marshall mentions seeing when validating an XML-style "self-closing" tag.  Compare how the W3C validator parses this with how web browsers render it:  the web browsers that I have tested all render "Text" as bold, indicating that the style attribute was parsed as part of the P element.&lt;/p&gt;

&lt;p&gt;Test document:&lt;/p&gt;

&lt;pre&gt;
&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD HTML 4.01//EN&#34; &#34;http://www.w3.org/TR/html4/strict.dtd&#34;&#62;
&#60;html&#62;
  &#60;head&#62;
    &#60;title&#62;Test Page&#60;/title&#62;
  &#60;/head&#62;
  &#60;body&#62;
    &#60;p /=&#34;a&#34; style=&#34;font-weight: bold;&#34;&#62;Text&#60;/p&#62;
    &#60;p&#62;More text&#60;/p&#62;
  &#60;/body&#62;
&#60;/html&#62;
&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>Try validating the following HTML document in the W3C validator with the &#8220;Show parse tree&#8221; option enabled.  It shows that it parses everything after the forward-slash as being the content of the tag.  This explains the extra &gt; that Robert Marshall mentions seeing when validating an XML-style &#8220;self-closing&#8221; tag.  Compare how the W3C validator parses this with how web browsers render it:  the web browsers that I have tested all render &#8220;Text&#8221; as bold, indicating that the style attribute was parsed as part of the P element.</p>

<p>Test document:</p>

<pre>
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Test Page&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;p /=&quot;a&quot; style=&quot;font-weight: bold;&quot;&gt;Text&lt;/p&gt;
    &lt;p&gt;More text&lt;/p&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre>]]></content:encoded>
	</item>
	<item>
		<title>By: Trey</title>
		<link>http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-9</link>
		<dc:creator>Trey</dc:creator>
		<pubDate>Mon, 02 Oct 2006 16:15:33 +0000</pubDate>
		<guid isPermaLink="false">http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-9</guid>
		<description>&lt;p&gt;If a self-closing tag isn't a valid attribute, why does the W3C validator let it go without so much as a warning?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>If a self-closing tag isn&#8217;t a valid attribute, why does the W3C validator let it go without so much as a warning?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Rowe</title>
		<link>http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-8</link>
		<dc:creator>Mark Rowe</dc:creator>
		<pubDate>Mon, 02 Oct 2006 12:31:09 +0000</pubDate>
		<guid isPermaLink="false">http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-8</guid>
		<description>&lt;p&gt;The reason that &#60;img src=&#34;#&#34; /&#62; is parsed as valid HTML is that the forward slash is parsed as an attribute name with no value.  As the forward slash is not a valid attribute name, it is ignored.  This trick only works for elements which HTML declares as self-closing tags (&#60;img&#62; and &#60;br&#62; being the most common).  To be clear, in HTML the trailing forward slash in no way indicates the closing of a tag.&lt;/p&gt;

&lt;p&gt;Trey, there are many instances in which XML-style &#34;self-closing&#34; tags will break when parsed using an HTML parser.  The &#60;script /&#62; example is mentioned in the WebKit blog post, and reference is made to the fact that a construct such as &#34;&#60;p&#62;&#60;b /&#62;Test&#60;/p&#62;&#34; will result in a bold word when parsed as HTML but non-bold when parsed as XHTML.&lt;/p&gt;

&lt;p&gt;I can assure you that Maciej is quite correct in stating that XHTML served as text/html is leaning very heavily on HTML parsers error handling.&lt;/p&gt;

&lt;p&gt;[sigh, can you please remove my initial comment with literal HTML tags in it?  It'd be good if the comment form had some indication of the format it expects input in ;-)]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The reason that &lt;img src=&quot;#&quot; /&gt; is parsed as valid HTML is that the forward slash is parsed as an attribute name with no value.  As the forward slash is not a valid attribute name, it is ignored.  This trick only works for elements which HTML declares as self-closing tags (&lt;img&gt; and &lt;br&gt; being the most common).  To be clear, in HTML the trailing forward slash in no way indicates the closing of a tag.</p>

<p>Trey, there are many instances in which XML-style &quot;self-closing&quot; tags will break when parsed using an HTML parser.  The &lt;script /&gt; example is mentioned in the WebKit blog post, and reference is made to the fact that a construct such as &quot;&lt;p&gt;&lt;b /&gt;Test&lt;/p&gt;&quot; will result in a bold word when parsed as HTML but non-bold when parsed as XHTML.</p>

<p>I can assure you that Maciej is quite correct in stating that XHTML served as text/html is leaning very heavily on HTML parsers error handling.</p>

<p>[sigh, can you please remove my initial comment with literal HTML tags in it?  It'd be good if the comment form had some indication of the format it expects input in ;-)]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Trey</title>
		<link>http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-6</link>
		<dc:creator>Trey</dc:creator>
		<pubDate>Mon, 02 Oct 2006 02:44:04 +0000</pubDate>
		<guid isPermaLink="false">http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-6</guid>
		<description>&lt;p&gt;So, when the author of that article says:&lt;/p&gt;

&lt;blockquote cite="http://webkit.org/blog/?p=68"&gt;&lt;p&gt;the vast majority of supposedly XHTML documents on the internet are served as text/html. Which means they are not XHTML at all, but actually invalid HTML that’s getting by on the error handling of HTML parsers.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;That isn't technically correct, because most of XHTML-type markup will validate as HTML.  The only self-closing tag that I've found that HTML validation isn't happy with are &lt;code&gt;meta&lt;/code&gt; tags.  Maybe self-closing tags and other XML-style markup just isn't as "proper" for plain HTML?  I don't know.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>So, when the author of that article says:</p>

<blockquote cite="http://webkit.org/blog/?p=68"><p>the vast majority of supposedly XHTML documents on the internet are served as text/html. Which means they are not XHTML at all, but actually invalid HTML that’s getting by on the error handling of HTML parsers.</p></blockquote>

<p>That isn&#8217;t technically correct, because most of XHTML-type markup will validate as HTML.  The only self-closing tag that I&#8217;ve found that HTML validation isn&#8217;t happy with are <code>meta</code> tags.  Maybe self-closing tags and other XML-style markup just isn&#8217;t as &#8220;proper&#8221; for plain HTML?  I don&#8217;t know.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Marshall</title>
		<link>http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-5</link>
		<dc:creator>Robert Marshall</dc:creator>
		<pubDate>Sun, 01 Oct 2006 14:59:08 +0000</pubDate>
		<guid isPermaLink="false">http://solutions.treypiepmeier.com/2006/10/01/xhtml-vs-html/#comment-5</guid>
		<description>&lt;p&gt;Because the forward slash is a technically valid way of closing the IMG tag in HTML. If you validate such a page with the W3 validator and "Show Parse Tree" turned on, you'll see a literal "&#62;" after it.&lt;/p&gt;

&lt;p&gt;The fact that no major browser will ever parse like the validator is one of those wonderful tag soup details. :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Because the forward slash is a technically valid way of closing the IMG tag in HTML. If you validate such a page with the W3 validator and &#8220;Show Parse Tree&#8221; turned on, you&#8217;ll see a literal &#8220;&gt;&#8221; after it.</p>

<p>The fact that no major browser will ever parse like the validator is one of those wonderful tag soup details. :)</p>]]></content:encoded>
	</item>
</channel>
</rss>
