<?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>HTML 5 &#187; Syntax</title>
	<atom:link href="http://www.htmlfive.net/category/syntax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.htmlfive.net</link>
	<description>A central location for HTML5 news and updates</description>
	<lastBuildDate>Mon, 09 Jan 2012 15:56:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Validator.nu HTML Parser Version 1.3.1 Released</title>
		<link>http://www.htmlfive.net/validator-nu-html-parser-version-1-3-1-released/</link>
		<comments>http://www.htmlfive.net/validator-nu-html-parser-version-1-3-1-released/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 16:02:32 +0000</pubDate>
		<dc:creator>Henri Sivonen</dc:creator>
				<category><![CDATA[Syntax]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=12354</guid>
		<description><![CDATA[There is now a new release of the Validator.nu HTML Parser. The new release contains files that were missing from the previous release package by accident. It also contains one tree builder correctness fix and one error reporting improvement.]]></description>
			<content:encoded><![CDATA[<p>There is now a new release of the <a href="http://about.validator.nu/htmlparser/">Validator.nu HTML Parser</a>. The new release contains files that were missing from the previous release package by accident. It also contains one tree builder correctness fix and one error reporting improvement.</p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/validator-nu-html-parser-version-1-3-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Version 1.3 of the Validator.nu HTML Parser Released</title>
		<link>http://www.htmlfive.net/version-1-3-of-the-validator-nu-html-parser-released/</link>
		<comments>http://www.htmlfive.net/version-1-3-of-the-validator-nu-html-parser-released/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 13:20:44 +0000</pubDate>
		<dc:creator>Henri Sivonen</dc:creator>
				<category><![CDATA[Syntax]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=8448</guid>
		<description><![CDATA[After over a year without proper releases, there is now a new release of the Validator.nu HTML Parser. There have been numerous changes to the HTML5 spec and, consequently, to the parser since the previous release. All users of the parser should update to the latest release in order to run a version that corresponds [...]]]></description>
			<content:encoded><![CDATA[<p>After over a year without proper releases, there is now a new release of the <a href="http://about.validator.nu/htmlparser/">Validator.nu HTML Parser</a>. There have been numerous changes to the HTML5 spec and, consequently, to the parser since the previous release. All users of the parser should update to the latest release in order to run a version that corresponds to the current spec.</p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/version-1-3-of-the-validator-nu-html-parser-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XHTML5 in a nutshell</title>
		<link>http://www.htmlfive.net/xhtml5-in-a-nutshell/</link>
		<comments>http://www.htmlfive.net/xhtml5-in-a-nutshell/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 05:51:58 +0000</pubDate>
		<dc:creator>Sergey Mavrody</dc:creator>
				<category><![CDATA[Syntax]]></category>
		<category><![CDATA[WHATWG]]></category>
		<category><![CDATA[What's Next]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=2878</guid>
		<description><![CDATA[The WHATWG Wiki portal has a nice section describing HTML vs. XHTML differences, as well as specifics of a polyglot HTML document that also would be able to serve HTML5 document as valid XML document. I'd like to review what it takes to transform an HTML5 polyglot document into a valid XHTML5 document: it appears, [...]]]></description>
			<content:encoded><![CDATA[<p>The WHATWG Wiki portal has a nice section describing HTML vs. XHTML differences, as well as specifics of a polyglot HTML document that also would be able to serve HTML5 document as valid XML document. I'd like to review what it takes to transform an HTML5 polyglot document into a valid XHTML5 document: it appears, finally the 'XHTML5' has become an official name.</p>

<p>The W3C first public working draft of "Polyglot Markup" recommendation describes <em>polyglot </em>HTML document as a document that conforms to both the HTML and XHTML syntax by using a common subset of both the HTML and XHTML and in a nutshell the HTML5 polyglot document is:</p>
<ul>
	<li>HTML5 doctype/namespace</li>
	<li>XHTML well-formed syntax</li>
</ul>
Polyglot document could serve as either HTML or XHTML, depending on browser support and MIME type. A polyglot HTML5 code essentially becomes XHTML5 document if it is served with the XML MIME type <code>application/xhtml+xml</code> .

In a nutshell the XHTML5 document is:
<ul>
	<li>HTML doctype/namespace: The <code>&lt;!DOCTYPE html&gt;</code>
definition is optional, but it would be useful in a polyglot document by  preventing browser quirks mode.</li>
	<li>XHTML well-formed syntax</li>
	<li>XML MIME type: <code> application/xhtml+xml</code>.
This MIME declaration is not visible in the source code, but it would appear in the HTTP Content-Type header that could be configured on the server. Of course, the XML MIME type is not yet supported by the current version Internet Explorer though IE can render XHTML documents.</li>
	<li>Default XHTML namespace: <code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;</code></li>
	<li>Secondary namespace such as SVG, MathML, Xlink, etc. To me this is like a test, if you don’t have a need for these namespaces  in your document, then the use of XHTML is overkill in the first place.</li>
</ul>
Finally, the basic XHTML5 document would look like this:
<div style="margin-top: 15px;padding: 0 40px">
<blockquote><code> </code>
<div><span style="color: #888888">&lt;!DOCTYPE html&gt;</span></div>
<code> </code>
<div>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;</div>
<code> </code>
<div style="padding-left: 15px">&lt;head&gt;</div>
<code> </code>
<div style="padding-left: 30px">&lt;title&gt;&lt;/title&gt;</div>
<div style="padding-left: 30px"><span style="color: #888888">&lt;meta charset="UTF-8" /&gt;</span></div>
<p style="padding-left: 15px">&lt;/head&gt;</p>
<code> </code>
<div style="padding-left: 15px">&lt;body&gt;</div>
<div>
<div>
<div style="padding-left: 30px"><span style="color: #888888">&lt;svg xmlns="http://www.w3.org/2000/svg"&gt;</span></div>
<div style="padding-left: 60px"><span style="color: #999999">&lt;rect stroke="black" fill="blue" x="45px" y="45px" width="200px" height="100px" stroke-width="2" /&gt;</span></div>
<div style="padding-left: 30px"><span style="color: #888888">&lt;/svg&gt;</span></div>
</div>
</div>
<div style="padding-left: 15px">&lt;/body&gt;</div>
<div>&lt;/html&gt;</div></blockquote>
</div>
<p>The XML declaration <code>&lt;?xml version=”1.0” encoding=”UTF-8”?&gt;</code> is not required if the default UTF-8 encoding is used: an XHTML5 validator would not mind if it is omitted. However it is strongly recommended to configure the encoding using server HTTP <code>Content-Type</code> header, otherwise this character encoding could be included in the document as part of a meta tag <code>&lt;meta charset="UTF-8" /&gt;</code>. This encoding declaration would be needed for a polyglot document so that it will be treated as UTF-8 if served as either HTML or XHTML.</p>

<p>The <em>Total Validator Tool</em> - Firefox plugin/desktop app has now the user-selectable option for XHTML5-specific  validation.</p>
<p style="margin-bottom: 40px">I would say that the main advantage of using XHTML5 would be the ability to extend HTML5 to XML-based technologies such as SVG and MathML. The disadvantage is the lack of Internet Explorer support, more verbose code, and error handling. Unless we need that extensibility, HTML5 is the way to go.</p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/xhtml5-in-a-nutshell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 Rationale document</title>
		<link>http://www.htmlfive.net/html5-rationale-document/</link>
		<comments>http://www.htmlfive.net/html5-rationale-document/#comments</comments>
		<pubDate>Mon, 10 May 2010 17:15:46 +0000</pubDate>
		<dc:creator>Eitan Adler</dc:creator>
				<category><![CDATA[Syntax]]></category>
		<category><![CDATA[WHATWG]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=2443</guid>
		<description><![CDATA[I've started a page on the wiki to document the rationale for the decisions made about the HTML specification. There are two goals for this document: Explain why things are the way they are Explain the difference between multiple similar elements by providing example usages. One person can not possibly write the entire thing so [...]]]></description>
			<content:encoded><![CDATA[<p>I've started a page on the wiki to document the <a href="http://wiki.whatwg.org/wiki/index.php?title=Rationale">rationale</a> for the decisions made about the HTML specification. </p>

<p>There are two goals for this document:</p>
<ol>
<li>Explain why things are the way they are</li>
<li>Explain the difference between multiple similar elements by providing example usages.</li>
</ol>

<p>One person can not possibly write the entire thing so I hope that this becomes a group process where anyone interested can contribute so go <a href="http://wiki.whatwg.org/index.php?title=Special:UserLogin&amp;type=signup">sign up</a>, <a href="http://wiki.whatwg.org/index.php?title=Special:UserLogin">log in,</a> and <a href="http://wiki.whatwg.org/index.php?title=Rationale&amp;action=edit">edit</a><!--???,PROFIT-->.</p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/html5-rationale-document/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validator.nu HTML Parser 1.2.0</title>
		<link>http://www.htmlfive.net/validatornu-html-parser-120/</link>
		<comments>http://www.htmlfive.net/validatornu-html-parser-120/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 15:40:13 +0000</pubDate>
		<dc:creator>Henri Sivonen</dc:creator>
				<category><![CDATA[Processing Model]]></category>
		<category><![CDATA[Syntax]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=639</guid>
		<description><![CDATA[<p>I put together a new release of the <a href="http://about.validator.nu/htmlparser/">Validator.nu HTML Parser</a>. This is a highly recommended update for everyone who is using a previous version the parser in an application.</p>
<ul>

<li>Fixed an issue where under rare circumstances attribute values were leaking into element content.</li>

<li>Fixed a bug where <code>isindex</code> processing added attributes to all elements that were supposed to have no attributes.</li>

<li>Implemented spec changes. (Too numerous to enumerate, but, as a highlight, framesets parse much better now.)</li>

<li>Moved to WebKit-style foster parenting.</li>

<li>Changed the API for tree builder subclasses again due to new constraints. If you have previously written your own tree builder subclass, you need to change it.</li>

<li>Fixed the bundled XML serializer.</li>

<li>Made it possible to generate a C++ version that does not leak memory from the Java source.</li>

<li>Removed the C++ translator from the release. (Get it from SVN.)</li>

</ul>
]]></description>
			<content:encoded><![CDATA[<p>I put together a new release of the <a href="http://about.validator.nu/htmlparser/">Validator.nu HTML Parser</a>. This is a highly recommended update for everyone who is using a previous version the parser in an application.</p>
<ul>

<li>Fixed an issue where under rare circumstances attribute values were leaking into element content.</li>

<li>Fixed a bug where <code>isindex</code> processing added attributes to all elements that were supposed to have no attributes.</li>

<li>Implemented spec changes. (Too numerous to enumerate, but, as a highlight, framesets parse much better now.)</li>

<li>Moved to WebKit-style foster parenting.</li>

<li>Changed the API for tree builder subclasses again due to new constraints. If you have previously written your own tree builder subclass, you need to change it.</li>

<li>Fixed the bundled XML serializer.</li>

<li>Made it possible to generate a C++ version that does not leak memory from the Java source.</li>

<li>Removed the C++ translator from the release. (Get it from SVN.)</li>

</ul>
<p></p><p>This item was originally posted at: <a href='http://blog.whatwg.org'>http://blog.whatwg.org</a> and is licensed under the <a href='http://www.opensource.org/licenses/mit-license.php'>MIT license</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/validatornu-html-parser-120/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Supporting New Elements in IE</title>
		<link>http://www.htmlfive.net/supporting-new-elements-in-ie/</link>
		<comments>http://www.htmlfive.net/supporting-new-elements-in-ie/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 16:26:28 +0000</pubDate>
		<dc:creator>Lachlan Hunt</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Syntax]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=484</guid>
		<description><![CDATA[<p>Internet Explorer poses a small challenge when it comes to making use of the new elements introduced in HTML5.  Among others, these include elements like <code>section</code>, <code>article</code>, <code>header</code> and <code>footer</code>. The problem is that due to the way parsing works in IE, these elements are not recognised properly and result in an anomalous DOM representation.</p>

<p>To illustrate, consider this simple document fragment:</p>

<pre>&#60;body&#62;
  &#60;section&#62;
    &#60;p&#62;This is an example&#60;/p&#62;
  &#60;/section&#62;
&#60;/body&#62;</pre>

<p>Strangely, IE 6, 7 and 8 all fail to parse the <code>section</code> element properly and the resulting DOM looks like this.</p>

<ul>
	<li><code>BODY</code>
		<ul>
			<li><code>SECTION</code></li>
			<li><code>P</code>
				<ul>
					<li><code>#text</code>: This is an example</li>
				</ul>
			</li>
			<li><code>/SECTION</code></li>
		</ul>
	</li>
</ul>

<p>Notice how IE actually creates 2 empty elements.  One named <code>SECTION</code> and the other named <code>/SECTION</code>. Yes, it really is parsing the end tag as a start tag for an unknown empty element.</p>

<p>There is a handy workaround available to address this problem, which was first revealed in <a href="http://intertwingly.net/blog/2008/01/22/Best-Standards-Support#c1201006277">a comment by Sjoerd Visscher</a>.

The basic concept is that by using <code>document.createElement(<var>tagName</var>)</code> to create each of the unknown elements, the parser in IE then recognises those elements and parses them in a more reasonable and useful way. e.g. By using the following script:</p>

<pre>document.createElement("section");</pre>

<p>The resulting DOM for the fragment given above looks like this:</p>

<ul>
	<li><code>BODY</code>
		<ul>
			<li><code>section</code>
				<ul>
					<li><code>P</code>
						<ul>
							<li><code>#text</code>: This is an example</li>
						</ul>
					</li>
				</ul>
			</li>
		</ul>
	</li>
</ul>

<p>This same technique works for all unknown elements in IE 6, 7 and 8.  Note that there is a known bug that prevented this from working in IE 8 beta 2, but this has since been resolved in the latest non-public technical preview.</p>

<p>For convenience, Remy Sharp has written and <a href="http://remysharp.com/2009/01/07/html5-enabling-script/">published a simple script</a> that provides this enhancement for all new elements in the current draft of HTML5, which you can download and use.</p>

<p>This script is not needed for other browsers. Opera 9, Firefox 3 and Safari 3 all parse unknown elements in a more reasonable way by default. Note, however, that Firefox 2 does suffer from some related problems, for which there is unfortunately no known solution; but it is hoped that given the faster upgrade cycle for users of Firefox, relatively speaking compared with IE, Firefox 2 won't pose too much of a problem in the future.</p>]]></description>
			<content:encoded><![CDATA[<p>Internet Explorer poses a small challenge when it comes to making use of the new elements introduced in HTML5.  Among others, these include elements like <code>section</code>, <code>article</code>, <code>header</code> and <code>footer</code>. The problem is that due to the way parsing works in IE, these elements are not recognised properly and result in an anomalous DOM representation.</p>

<p>To illustrate, consider this simple document fragment:</p>

<pre>&lt;body&gt;
  &lt;section&gt;
    &lt;p&gt;This is an example&lt;/p&gt;
  &lt;/section&gt;
&lt;/body&gt;</pre>

<p>Strangely, IE 6, 7 and 8 all fail to parse the <code>section</code> element properly and the resulting DOM looks like this.</p>

<ul>
	<li><code>BODY</code>
		<ul>
			<li><code>SECTION</code></li>
			<li><code>P</code>
				<ul>
					<li><code>#text</code>: This is an example</li>
				</ul>
			</li>
			<li><code>/SECTION</code></li>
		</ul>
	</li>
</ul>

<p>Notice how IE actually creates 2 empty elements.  One named <code>SECTION</code> and the other named <code>/SECTION</code>. Yes, it really is parsing the end tag as a start tag for an unknown empty element.</p>

<p>There is a handy workaround available to address this problem, which was first revealed in <a href="http://intertwingly.net/blog/2008/01/22/Best-Standards-Support#c1201006277">a comment by Sjoerd Visscher</a>.

The basic concept is that by using <code>document.createElement(<var>tagName</var>)</code> to create each of the unknown elements, the parser in IE then recognises those elements and parses them in a more reasonable and useful way. e.g. By using the following script:</p>

<pre>document.createElement("section");</pre>

<p>The resulting DOM for the fragment given above looks like this:</p>

<ul>
	<li><code>BODY</code>
		<ul>
			<li><code>section</code>
				<ul>
					<li><code>P</code>
						<ul>
							<li><code>#text</code>: This is an example</li>
						</ul>
					</li>
				</ul>
			</li>
		</ul>
	</li>
</ul>

<p>This same technique works for all unknown elements in IE 6, 7 and 8.  Note that there is a known bug that prevented this from working in IE 8 beta 2, but this has since been resolved in the latest non-public technical preview.</p>

<p>For convenience, Remy Sharp has written and <a href="http://remysharp.com/2009/01/07/html5-enabling-script/">published a simple script</a> that provides this enhancement for all new elements in the current draft of HTML5, which you can download and use.</p>

<p>This script is not needed for other browsers. Opera 9, Firefox 3 and Safari 3 all parse unknown elements in a more reasonable way by default. Note, however, that Firefox 2 does suffer from some related problems, for which there is unfortunately no known solution; but it is hoped that given the faster upgrade cycle for users of Firefox, relatively speaking compared with IE, Firefox 2 won't pose too much of a problem in the future.</p><p></p><p>This item was originally posted at: <a href='http://blog.whatwg.org'>http://blog.whatwg.org</a> and is licensed under the <a href='http://www.opensource.org/licenses/mit-license.php'>MIT license</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/supporting-new-elements-in-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Tech Talk: HTML5 demos</title>
		<link>http://www.htmlfive.net/google-tech-talk-html5-demos/</link>
		<comments>http://www.htmlfive.net/google-tech-talk-html5-demos/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 23:49:13 +0000</pubDate>
		<dc:creator>Ian Hickson</dc:creator>
				<category><![CDATA[Browser API]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Conformance Checking]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Syntax]]></category>
		<category><![CDATA[WHATWG]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=300</guid>
		<description><![CDATA[<p>I gave a talk at Google on Monday demonstrating the various features of HTML5 that are implemented in browsers today. The video is now on YouTube, so now you too can watch and laugh at my lame presentation skills!</p>
<p></p>
<p>The segments of this talk are as follows. Some of the demos are available online for you to play with and are linked to from the following list:</p>
<ol>
 <li> Introduction
 </li><li> <a href="http://whatwg.org/demos/2008-sept/video/video.html"><code>&#60;video&#62;</code></a> (00:35)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/gadget-host/host.html"><code>postMessage()</code></a> (05:40)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/editor/editor.html"><code>localStorage</code></a> (15:20)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/wizard/step1.html"><code>sessionStorage</code></a> (21:00)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/dnd/dnd.html">Drag and Drop API</a> (29:05)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/hashchange/hashchange.html"><code>onhashchange</code></a> (37:30)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/widgets/">Form Controls</a> (40:50)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/color/color.html"><code>&#60;canvas&#62;</code></a> (56:55)
 </li><li> <a href="http://html5.validator.nu/">Validation</a> (1:07:20)
 </li><li> Questions and Answers (1:09:35)
</li></ol>
<p>If you're very interested in watching my typos, the high quality version of <a href="http://www.youtube.com/watch?v=xIxDJof7xxQ&#38;eurl=http://www.whatwg.org/demos/2008-sept/">the video on the YouTube site</a> is clear enough to see the text being typed. More details about the demos can be found on the corresponding <a href="http://whatwg.org/demos/2008-sept/">demo page</a>.</p>]]></description>
			<content:encoded><![CDATA[<p>I gave a talk at Google on Monday demonstrating the various features of HTML5 that are implemented in browsers today. The video is now on YouTube, so now you too can watch and laugh at my lame presentation skills!</p>
<p></p>
<p>The segments of this talk are as follows. Some of the demos are available online for you to play with and are linked to from the following list:</p>
<ol>
 <li> Introduction
 </li><li> <a href="http://whatwg.org/demos/2008-sept/video/video.html"><code>&lt;video&gt;</code></a> (00:35)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/gadget-host/host.html"><code>postMessage()</code></a> (05:40)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/editor/editor.html"><code>localStorage</code></a> (15:20)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/wizard/step1.html"><code>sessionStorage</code></a> (21:00)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/dnd/dnd.html">Drag and Drop API</a> (29:05)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/hashchange/hashchange.html"><code>onhashchange</code></a> (37:30)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/widgets/">Form Controls</a> (40:50)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/color/color.html"><code>&lt;canvas&gt;</code></a> (56:55)
 </li><li> <a href="http://html5.validator.nu/">Validation</a> (1:07:20)
 </li><li> Questions and Answers (1:09:35)
</li></ol>
<p>If you're very interested in watching my typos, the high quality version of <a href="http://www.youtube.com/watch?v=xIxDJof7xxQ&#38;eurl=http://www.whatwg.org/demos/2008-sept/">the video on the YouTube site</a> is clear enough to see the text being typed. More details about the demos can be found on the corresponding <a href="http://whatwg.org/demos/2008-sept/">demo page</a>.</p><p></p><p>This item was originally posted at: <a href='http://blog.whatwg.org'>http://blog.whatwg.org</a> and is licensed under the <a href='http://www.opensource.org/licenses/mit-license.php'>MIT license</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/google-tech-talk-html5-demos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validator.nu HTML Parser 1.1.0</title>
		<link>http://www.htmlfive.net/validatornu-html-parser-110/</link>
		<comments>http://www.htmlfive.net/validatornu-html-parser-110/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 15:49:50 +0000</pubDate>
		<dc:creator>Henri Sivonen</dc:creator>
				<category><![CDATA[Syntax]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=267</guid>
		<description><![CDATA[<p>I have released a new version of the <a href="http://about.validator.nu/htmlparser/">Validator.nu HTML Parser</a> (an implementation of the HTML5 parsing algorithm in Java). The new release supports SVG and MathML subtrees, is faster than the old version, fixes bugs, is more portable and supports applications that want to do <code>document.write()</code>.</p>

<p>The parser comes with a sample app that makes it possible to use XSLT programs written for XHTML5+SVG+MathML with <code>text/html</code>.</p>

<p><strong>Warning!</strong> The internal APIs have changed. Please refer to the Upgrade Guide below.</p>

<h3>Change Log</h3>

<ul>

<li>Made the SAX, DOM and XOM parser entry point constructors default to altering the infoset instead of throwing when the input needs coercing to be an XML 1.0 4th ed. plus Namespaces infoset.</li>

<li>Isolated Java IO dependent code from the parser core. The parser core now compiles on Google Web Toolkit.</li>

<li>Refactored the tokenizer to use a <code>switch</code> branch per state instead of method per state.</li>

<li>Made various performance tweaks to the tokenizer.</li>

<li>Implemented support for MathML and SVG foreign content. (Note that the SVG part is based on spec text that has been commented out from the spec at the request of the SVG WG.)</li>

<li>Made the parser suspendable after any input character.</li>

<li>Made it possible for custom <code>TreeBuilder</code> subclasses to request parser suspension. (Applications wishing to implement <code>document.write()</code> should provide their own <code>TreeBuilder</code> subclass and a <code>document.write()</code>-aware replacement of the <code>Driver</code> class. Look in the <code>gwt-src/</code> directory for sample code.)</li>

<li>Made changes to the parser core to make it more suitable for mechanical translation into other object-oriented programming languages that have C-like control structures but not necessarily a garbage collector (with focus on targeting C++). This work is not complete.</li>

<li>Made the HTML serializer do the right thing when input represents a conforming XHTML+SVG+MathML tree. (Results may be bad for non-conforming input trees.)</li>

<li>Developed sample programs for converting between HTML5 and XHTML5 when the input is known to be conforming.</li>

<li>Provided an XML serializer so that the sample code no longer depends on the Xalan serializer.</li>

<li>Improved API documentation.</li>

<li>Fixed bugs in the tokenizer, tree builder and the input stream character encoding decoder.</li>

<li>Made coercion to an XML infoset work according to the HTML5 spec.</li>

<li>Added ID uniqueness checking.</li>

<li>Various other fixes.</li>

</ul>

<h3>Upgrade Guide from 1.0.7 to 1.1.0</h3>

<p>In all cases, you need to check that your application does not break when it receives SVG or MathML subtrees.</p>

<dl>
<dt>If you use the parser through the SAX, DOM or XOM API and <em>do not</em> pass an explicit <code>XmlViolationPolicy</code> to the constructor of <code>HtmlParser</code>, <code>HtmlDocumentBuilder</code> or <code>HtmlBuilder</code>:</dt>
<dd><p>If you really wanted the old default behavior, you should now pass <code>XmlViolationPolicy.FATAL</code> to the constructor.</p>
<p>If you did not really want to have fatal errors by default, you do not need to do anything, since <code>ALTER_INFOSET</code> is now the default.</p>
</dd>

<dt>If you use the parser through the SAX, DOM or XOM API and <em>do</em> pass an explicit <code>XmlViolationPolicy</code> to the constructor of <code>HtmlParser</code>, <code>HtmlDocumentBuilder</code> or <code>HtmlBuilder</code>:</dt>
<dd><p>You do not need to change your code to upgrade.</p></dd>

<dt>If you have your own subclass of <code>TreeBuilder</code>:</dt>
<dd><p>The abstract methods on <code>TreeBuilder</code> now have additional arguments for passing the namespace URI. You should upgrade your subclass to deal with the namespace URIs. (The URI is always an interned string, so you can use <code>==</code> to compare.)</p>

<p>The entry point for passing in a SAX <code>InputSource</code> has moved from the <code>Tokenizer</code> class to the <code>Driver</code> class (in the <code>io</code> package), so you should change your references from <code>Tokenizer</code> to <code>Driver</code>.</p>
</dd>

<dt>If you have your own implementation of <code>TokenHandler</code>:</dt>
<dd><p>Please refer to the JavaDocs of <code>TokenHandler</code>. Also note the new separation of <code>Tokenizer</code> and <code>Driver</code> mentioned above.</p></dd>
</dl>


]]></description>
			<content:encoded><![CDATA[<p>I have released a new version of the <a href="http://about.validator.nu/htmlparser/">Validator.nu HTML Parser</a> (an implementation of the HTML5 parsing algorithm in Java). The new release supports SVG and MathML subtrees, is faster than the old version, fixes bugs, is more portable and supports applications that want to do <code>document.write()</code>.</p>

<p>The parser comes with a sample app that makes it possible to use XSLT programs written for XHTML5+SVG+MathML with <code>text/html</code>.</p>

<p><strong>Warning!</strong> The internal APIs have changed. Please refer to the Upgrade Guide below.</p>

<h3>Change Log</h3>

<ul>

<li>Made the SAX, DOM and XOM parser entry point constructors default to altering the infoset instead of throwing when the input needs coercing to be an XML 1.0 4th ed. plus Namespaces infoset.</li>

<li>Isolated Java IO dependent code from the parser core. The parser core now compiles on Google Web Toolkit.</li>

<li>Refactored the tokenizer to use a <code>switch</code> branch per state instead of method per state.</li>

<li>Made various performance tweaks to the tokenizer.</li>

<li>Implemented support for MathML and SVG foreign content. (Note that the SVG part is based on spec text that has been commented out from the spec at the request of the SVG WG.)</li>

<li>Made the parser suspendable after any input character.</li>

<li>Made it possible for custom <code>TreeBuilder</code> subclasses to request parser suspension. (Applications wishing to implement <code>document.write()</code> should provide their own <code>TreeBuilder</code> subclass and a <code>document.write()</code>-aware replacement of the <code>Driver</code> class. Look in the <code>gwt-src/</code> directory for sample code.)</li>

<li>Made changes to the parser core to make it more suitable for mechanical translation into other object-oriented programming languages that have C-like control structures but not necessarily a garbage collector (with focus on targeting C++). This work is not complete.</li>

<li>Made the HTML serializer do the right thing when input represents a conforming XHTML+SVG+MathML tree. (Results may be bad for non-conforming input trees.)</li>

<li>Developed sample programs for converting between HTML5 and XHTML5 when the input is known to be conforming.</li>

<li>Provided an XML serializer so that the sample code no longer depends on the Xalan serializer.</li>

<li>Improved API documentation.</li>

<li>Fixed bugs in the tokenizer, tree builder and the input stream character encoding decoder.</li>

<li>Made coercion to an XML infoset work according to the HTML5 spec.</li>

<li>Added ID uniqueness checking.</li>

<li>Various other fixes.</li>

</ul>

<h3>Upgrade Guide from 1.0.7 to 1.1.0</h3>

<p>In all cases, you need to check that your application does not break when it receives SVG or MathML subtrees.</p>

<dl>
<dt>If you use the parser through the SAX, DOM or XOM API and <em>do not</em> pass an explicit <code>XmlViolationPolicy</code> to the constructor of <code>HtmlParser</code>, <code>HtmlDocumentBuilder</code> or <code>HtmlBuilder</code>:</dt>
<dd><p>If you really wanted the old default behavior, you should now pass <code>XmlViolationPolicy.FATAL</code> to the constructor.</p>
<p>If you did not really want to have fatal errors by default, you do not need to do anything, since <code>ALTER_INFOSET</code> is now the default.</p>
</dd>

<dt>If you use the parser through the SAX, DOM or XOM API and <em>do</em> pass an explicit <code>XmlViolationPolicy</code> to the constructor of <code>HtmlParser</code>, <code>HtmlDocumentBuilder</code> or <code>HtmlBuilder</code>:</dt>
<dd><p>You do not need to change your code to upgrade.</p></dd>

<dt>If you have your own subclass of <code>TreeBuilder</code>:</dt>
<dd><p>The abstract methods on <code>TreeBuilder</code> now have additional arguments for passing the namespace URI. You should upgrade your subclass to deal with the namespace URIs. (The URI is always an interned string, so you can use <code>==</code> to compare.)</p>

<p>The entry point for passing in a SAX <code>InputSource</code> has moved from the <code>Tokenizer</code> class to the <code>Driver</code> class (in the <code>io</code> package), so you should change your references from <code>Tokenizer</code> to <code>Driver</code>.</p>
</dd>

<dt>If you have your own implementation of <code>TokenHandler</code>:</dt>
<dd><p>Please refer to the JavaDocs of <code>TokenHandler</code>. Also note the new separation of <code>Tokenizer</code> and <code>Driver</code> mentioned above.</p></dd>
</dl>


<p></p><p>This item was originally posted at: <a href='http://blog.whatwg.org'>http://blog.whatwg.org</a> and is licensed under the <a href='http://www.opensource.org/licenses/mit-license.php'>MIT license</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/validatornu-html-parser-110/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML5 Live DOM Viewer—Now in Your Browser</title>
		<link>http://www.htmlfive.net/html5-live-dom-viewer%e2%80%94now-in-your-browser/</link>
		<comments>http://www.htmlfive.net/html5-live-dom-viewer%e2%80%94now-in-your-browser/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 12:27:30 +0000</pubDate>
		<dc:creator>Henri Sivonen</dc:creator>
				<category><![CDATA[DOM]]></category>
		<category><![CDATA[Syntax]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=239</guid>
		<description><![CDATA[<p>Earlier, I <a href="http://blog.whatwg.org/html5-live-dom-viewer">blogged</a> about running the Validator.nu HTML Parser inside Hixie’s Live DOM Viewer using the magic of the hosted mode of the Google Web Toolkit. Back then, a compiler bug in GTW 1.5 RC1 prevented the parser from running as JavaScript in the Web mode. Google has now <a href="http://code.google.com/webtoolkit/releases/release-notes-1.5.1.html">released</a> GWT 1.5 RC2, which contains a fix for the bug.</p>

<p>So without further ado, here’s <a href="http://livedom.validator.nu/">Live DOM Viewer with an HTML5 parser running as JavaScript in your browser</a>.</p>

<p>Try pasting in the <a href="http://www.croczilla.com/svg/samples/lion/lion.svg">SVG lion</a> or some <a href="http://www.mozilla.org/projects/mathml/demo/basics.xhtml">MathML</a> in Firefox 3 and Opera 9.5.</p>

<p>Known problems:</p>

<ul>
<li>SVG <code>use</code> does not work in Firefox. <em>Update: Fixed in Minefield nightlies.</em></li>
<li>SVG does not render is Safari.</li>
<li>IE does not support <code>createElementNS</code> and, thus, does not work at all.</li>
</ul>

<p>A big thanks for the GWT team for making this work!</p>]]></description>
			<content:encoded><![CDATA[<p>Earlier, I <a href="http://blog.whatwg.org/html5-live-dom-viewer">blogged</a> about running the Validator.nu HTML Parser inside Hixie’s Live DOM Viewer using the magic of the hosted mode of the Google Web Toolkit. Back then, a compiler bug in GTW 1.5 RC1 prevented the parser from running as JavaScript in the Web mode. Google has now <a href="http://code.google.com/webtoolkit/releases/release-notes-1.5.1.html">released</a> GWT 1.5 RC2, which contains a fix for the bug.</p>

<p>So without further ado, here’s <a href="http://livedom.validator.nu/">Live DOM Viewer with an HTML5 parser running as JavaScript in your browser</a>.</p>

<p>Try pasting in the <a href="http://www.croczilla.com/svg/samples/lion/lion.svg">SVG lion</a> or some <a href="http://www.mozilla.org/projects/mathml/demo/basics.xhtml">MathML</a> in Firefox 3 and Opera 9.5.</p>

<p>Known problems:</p>

<ul>
<li>SVG <code>use</code> does not work in Firefox. <em>Update: Fixed in Minefield nightlies.</em></li>
<li>SVG does not render is Safari.</li>
<li>IE does not support <code>createElementNS</code> and, thus, does not work at all.</li>
</ul>

<p>A big thanks for the GWT team for making this work!</p><p></p><p>This item was originally posted at: <a href='http://blog.whatwg.org'>http://blog.whatwg.org</a> and is licensed under the <a href='http://www.opensource.org/licenses/mit-license.php'>MIT license</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/html5-live-dom-viewer%e2%80%94now-in-your-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Experience the HTML5 parsing algorithm in the Live DOM Viewer</title>
		<link>http://www.htmlfive.net/experience-the-html5-parsing-algorithm-in-the-live-dom-viewer/</link>
		<comments>http://www.htmlfive.net/experience-the-html5-parsing-algorithm-in-the-live-dom-viewer/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 10:47:22 +0000</pubDate>
		<dc:creator>Henri Sivonen</dc:creator>
				<category><![CDATA[Syntax]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=195</guid>
		<description><![CDATA[<p>If you’ve investigated how browsers parse HTML, you’ve probably used Hixie’s <a href="http://software.hixie.ch/utilities/js/live-dom-viewer/">Live DOM Viewer</a> to see what happens. Wouldn’t it be cool, though, if you could experiment with the HTML5 parsing algorithm in the same UI? Well, now you can.</p>
<p>I was looking for a way to experiment with <code>document.write()</code> in the code base of the Validator.nu HTML Parser and I was looking for a way to let people see the parse tree output of the HTML5 parsing algorithm more easily. Instead of writing a test harness fully in Java, I thought it would be better to use the Live DOM Viewer and a browser engine as the test harness. The good news is that Google Web Toolkit makes it possible to put these pieces together, and the trunk of the Validator.nu HTML parser now comes with a <code>document.write()</code>-aware tokenizer driver and a tree builder subclass for GWT.</p>
<p>The bad news is that the Java-to-JavaScript compiler of GWT has <a href="http://code.google.com/p/google-web-toolkit/issues/detail?id=2069">a bug</a> that blocks me from putting the result online as JavaScript. The Hosted Mode of GWT, works, though.</p>
<p>Here’s how you can run the Validator.nu HTML Parser in the Live DOM Viewer locally in the Hosted Mode of GWT (on Mac or Linux):</p>
<ol>
<li>Check out the source: <kbd>svn co http://svn.versiondude.net/whattf/htmlparser/trunk/ htmlparser</kbd></li>
<li>Download and untar <a href="http://code.google.com/webtoolkit/versions.html">GWT 1.5 RC1</a></li>
<li>On Linux, install libstdc++5 and a JDK (Ubuntu's OpenJDK-based package worked for me).</li>
<li>Edit the paths in <code>HtmlParser-shell</code> (Mac) or <code>HtmlParser-linux</code> (Linux) to point to the location of GWT.</li>
<li>Run <code>HtmlParser-shell</code> (Mac) or <code>HtmlParser-linux</code> (Linux)</li>
</ol>
<p>Known problems:</p>
<ul>
<li>The Linux version of GWT runs an outdated version of Gecko, and the rendered view doesn't work. The DOM view does.</li>
<li>The Mac version of GWT runs a Web Inspector-enabled version of WebKit, but SVG does not draw.</li>
<li><code>document.write()</code> semantics are right only for inline scripts.</li>
<li>Copying and pasting using keyboard shortcuts doesn’t work. (Use the context menu.)</li>
<li>On Linux, GTW prints a lot of harmless warnings about not finding annotations. (I don’t know why that happens. The annotations should be among translatables.)</li>
<li>Gecko (used by GTW on Linux) doesn't allow the creation of xmlns attributes in no namespace, so things stop working if you try to put an attribute called <code>xmlns</code> on HTML elements.</li>
<li>The DOM view on Linux doesn't report names with colons in them per the HTML5 spec.</li>
</ul>
<p>(Aside: This code could have applicability beyond testing the parser. If the compiler bug were fixed or worked around, a script could <code>document.write()</code> a <code>math</code> element and an <code>svg</code> element to sniff if they are parsed according to HTML5 and if they aren't, move aside load event handlers, <code>document.write()</code> <code>&#60;plaintext style='display:none'&#62;</code>, wait until <code>DOMContentLoaded</code>, load the the already created <code>html</code>, <code>head</code> and <code>body</code> elements onto the tree builder stack and head pointer of the HTML5 parser to and reparse the content of the plaintext element as HTML5 and call the load event handlers. See <a href="http://canvex.lazyilluminati.com/misc/sexp.html">Philip Taylor’s proof of concept with S-expressions</a>.)</p>]]></description>
			<content:encoded><![CDATA[<p>If you’ve investigated how browsers parse HTML, you’ve probably used Hixie’s <a href="http://software.hixie.ch/utilities/js/live-dom-viewer/">Live DOM Viewer</a> to see what happens. Wouldn’t it be cool, though, if you could experiment with the HTML5 parsing algorithm in the same UI? Well, now you can.</p>
<p>I was looking for a way to experiment with <code>document.write()</code> in the code base of the Validator.nu HTML Parser and I was looking for a way to let people see the parse tree output of the HTML5 parsing algorithm more easily. Instead of writing a test harness fully in Java, I thought it would be better to use the Live DOM Viewer and a browser engine as the test harness. The good news is that Google Web Toolkit makes it possible to put these pieces together, and the trunk of the Validator.nu HTML parser now comes with a <code>document.write()</code>-aware tokenizer driver and a tree builder subclass for GWT.</p>
<p>The bad news is that the Java-to-JavaScript compiler of GWT has <a href="http://code.google.com/p/google-web-toolkit/issues/detail?id=2069">a bug</a> that blocks me from putting the result online as JavaScript. The Hosted Mode of GWT, works, though.</p>
<p>Here’s how you can run the Validator.nu HTML Parser in the Live DOM Viewer locally in the Hosted Mode of GWT (on Mac or Linux):</p>
<ol>
<li>Check out the source: <kbd>svn co http://svn.versiondude.net/whattf/htmlparser/trunk/ htmlparser</kbd></li>
<li>Download and untar <a href="http://code.google.com/webtoolkit/versions.html">GWT 1.5 RC1</a></li>
<li>On Linux, install libstdc++5 and a JDK (Ubuntu's OpenJDK-based package worked for me).</li>
<li>Edit the paths in <code>HtmlParser-shell</code> (Mac) or <code>HtmlParser-linux</code> (Linux) to point to the location of GWT.</li>
<li>Run <code>HtmlParser-shell</code> (Mac) or <code>HtmlParser-linux</code> (Linux)</li>
</ol>
<p>Known problems:</p>
<ul>
<li>The Linux version of GWT runs an outdated version of Gecko, and the rendered view doesn't work. The DOM view does.</li>
<li>The Mac version of GWT runs a Web Inspector-enabled version of WebKit, but SVG does not draw.</li>
<li><code>document.write()</code> semantics are right only for inline scripts.</li>
<li>Copying and pasting using keyboard shortcuts doesn’t work. (Use the context menu.)</li>
<li>On Linux, GTW prints a lot of harmless warnings about not finding annotations. (I don’t know why that happens. The annotations should be among translatables.)</li>
<li>Gecko (used by GTW on Linux) doesn't allow the creation of xmlns attributes in no namespace, so things stop working if you try to put an attribute called <code>xmlns</code> on HTML elements.</li>
<li>The DOM view on Linux doesn't report names with colons in them per the HTML5 spec.</li>
</ul>
<p>(Aside: This code could have applicability beyond testing the parser. If the compiler bug were fixed or worked around, a script could <code>document.write()</code> a <code>math</code> element and an <code>svg</code> element to sniff if they are parsed according to HTML5 and if they aren't, move aside load event handlers, <code>document.write()</code> <code>&lt;plaintext style='display:none'&gt;</code>, wait until <code>DOMContentLoaded</code>, load the the already created <code>html</code>, <code>head</code> and <code>body</code> elements onto the tree builder stack and head pointer of the HTML5 parser to and reparse the content of the plaintext element as HTML5 and call the load event handlers. See <a href="http://canvex.lazyilluminati.com/misc/sexp.html">Philip Taylor’s proof of concept with S-expressions</a>.)</p><p></p><p>This item was originally posted at: <a href='http://blog.whatwg.org'>http://blog.whatwg.org</a> and is licensed under the <a href='http://www.opensource.org/licenses/mit-license.php'>MIT license</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/experience-the-html5-parsing-algorithm-in-the-live-dom-viewer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

