<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.whatwg.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Brettz9</id>
	<title>WHATWG Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.whatwg.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Brettz9"/>
	<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/wiki/Special:Contributions/Brettz9"/>
	<updated>2026-05-22T22:23:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=User:Brettz9&amp;diff=9030</id>
		<title>User:Brettz9</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=User:Brettz9&amp;diff=9030"/>
		<updated>2013-02-21T01:44:26Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: +{{CC0 user}}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{CC0 user}}&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=MetaExtensions&amp;diff=8473</id>
		<title>MetaExtensions</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=MetaExtensions&amp;diff=8473"/>
		<updated>2012-08-19T09:32:43Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Registered Extensions */ +&amp;quot;entity&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;To create an account, please ask someone on [[IRC]] or e-mail [mailto:annevk@annevk.nl annevk@annevk.nl] or [mailto:ian@hixie.ch ian@hixie.ch]. We had to disable open signups because the level of spam became intolerable.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page lists the allowed extension values for the name=&amp;quot;&amp;quot; attribute of the &amp;amp;lt;meta&amp;gt; element in HTML5. You may add your own values to this list, which makes them legal HTML5 metadata names. We ask that you try to avoid redundancy; if someone has already defined a name that does roughly what you want, please reuse it. Also, please be sure to include &#039;&#039;all&#039;&#039; the items [http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#other-metadata-names required by the spec] &#039;&#039;including a link to a specification&#039;&#039; that specifies the keyword &#039;&#039;as an HTML meta keyword&#039;&#039;. Note that URL-valued properties must not be registered as meta names but should be registered as [http://microformats.org/wiki/existing-rel-values#HTML5_link_type_extensions rel keywords] instead. Also note that changes to this registry may not be reflected in validators in real time.&lt;br /&gt;
&lt;br /&gt;
== Registered Extensions ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Keyword&lt;br /&gt;
! Brief description&lt;br /&gt;
! Link to specification&lt;br /&gt;
! Synonyms&lt;br /&gt;
! Status&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| alexaverifyid&lt;br /&gt;
| Used to verify ownership of Alexa Search&lt;br /&gt;
| [http://www.alexa.com/faqs/?p=188 Alexa FAQ About this meta attribute Reference]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| tysontcsverid&lt;br /&gt;
| Used to verify ownership of Website for TCS webmaster tools&lt;br /&gt;
| [http://www.tysontcs.co.uk/Veridspec.html Livechat About this meta attribute Reference]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| apple-mobile-web-app-capable&lt;br /&gt;
| Sets whether a web application runs in full-screen mode.&lt;br /&gt;
| [http://developer.apple.com/library/safari/#documentation/appleapplications/reference/SafariHTMLRef/Articles/MetaTags.html Apple Safari HTML Reference]&lt;br /&gt;
| Could maybe be assumed when &amp;lt;code&amp;gt;application-name&amp;lt;/code&amp;gt; is set?&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| apple-mobile-web-app-status-bar-style&lt;br /&gt;
| Sets the style of the status bar for a web application.&lt;br /&gt;
| [http://developer.apple.com/library/safari/#documentation/appleapplications/reference/SafariHTMLRef/Articles/MetaTags.html Apple Safari HTML Reference]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| baiduspider&lt;br /&gt;
| Synonym of &amp;lt;code&amp;gt;robots&amp;lt;/code&amp;gt; for targeting Baidu only.&lt;br /&gt;
| [http://www.baidu.com/search/robots_english.html Baidu documentation]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| citeseerxbot&lt;br /&gt;
| Synonym of &amp;lt;code&amp;gt;robots&amp;lt;/code&amp;gt; for targeting CiteSeerX only.&lt;br /&gt;
| [http://csxstatic.ist.psu.edu/submit CiteSeerX Submit Documents] &amp;lt;small&amp;gt;&#039;If you do not want your documents crawled by CiteSeerX, please use a robots.txt to disallow our crawler named &amp;quot;citeseerxbot&amp;quot;&#039;&amp;lt;/small&amp;gt;, [http://csxstatic.ist.psu.edu/about/crawler CiteSeerX Crawler]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| csrf-param&lt;br /&gt;
| Cross-site request forgery protection parameter for Ruby on Rails&lt;br /&gt;
| [http://apidock.com/rails/ActionView/Helpers/CsrfHelper/csrf_meta_tag Rails API]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| csrf-token&lt;br /&gt;
| Cross-site request forgery protection token for Ruby on Rails&lt;br /&gt;
| [http://apidock.com/rails/ActionView/Helpers/CsrfHelper/csrf_meta_tag Rails API]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| dc.date.issued&lt;br /&gt;
| Date of publication for Google News. The format of the content is YYYY-MM-DD or YYYY-MM-DDThh:mm:ssTZD.&lt;br /&gt;
| [http://www.google.com/support/news_pub/bin/answer.py?answer=93994 Google News documentation]&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;time pubdate&amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dcterms.issued&amp;lt;/code&amp;gt;&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dc.language&lt;br /&gt;
| A language of the resource. Recommended best practice is to use a&lt;br /&gt;
controlled vocabulary such as RFC 4646 [RFC4646].&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-language DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| Redundant with the &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute on the&lt;br /&gt;
&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt; element. (Browsers pay attention to the &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute but not &amp;lt;code&amp;gt;dc.language&amp;lt;/code&amp;gt;)&lt;br /&gt;
&amp;lt;code&amp;gt;dc.language&amp;lt;/code&amp;gt; is preferred by several web validators over &amp;lt;code&amp;gt;dcterms.language&amp;lt;/code&amp;gt;&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.abstract&lt;br /&gt;
| A summary of the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-abstract DCMI&lt;br /&gt;
Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.accessRights&lt;br /&gt;
| Information about who can access the resource or an indication of its security status.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-accessRights DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.accrualMethod&lt;br /&gt;
| The method by which items are added to a collection.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-accrualMethod DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.accrualPeriodicity&lt;br /&gt;
| The frequency with which items are added to a collection.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-accrualPeriodicity DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.accrualPolicy&lt;br /&gt;
| The policy governing the addition of items to a collection.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-accrualPolicy DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.alternative&lt;br /&gt;
| An alternative name for the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-alternative DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.audience&lt;br /&gt;
| A class of entity for whom the resource is intended or useful.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-audience DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.available&lt;br /&gt;
| Date (often a range) that the resource became or will become available.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-available DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.bibliographicCitation&lt;br /&gt;
| A bibliographic reference for the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-bibliographicCitation DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| The HTML element &amp;lt;code&amp;gt;cite&amp;lt;/code&amp;gt;&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.conformsTo&lt;br /&gt;
| An established standard to which the described resource conforms.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-conformsTo DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.contributor&lt;br /&gt;
| An entity responsible for making contributions to the content of the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-contributor DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.coverage&lt;br /&gt;
| The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-coverage DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.created&lt;br /&gt;
| Date of creation of the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-created DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.creator&lt;br /&gt;
| An entity primarily responsible for making the resource. Examples of&lt;br /&gt;
a Creator include a person, an organization, or a service.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-creator DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| In some cases redundant with the HTML built-in keyword &lt;br /&gt;
| &amp;lt;code&amp;gt;author&amp;lt;/code&amp;gt; Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.date&lt;br /&gt;
| A point or period of time associated with an event in the lifecycle of the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-date DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.dateAccepted&lt;br /&gt;
| Date of acceptance of the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-dateAccepted DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.dateCopyrighted&lt;br /&gt;
| Date of copyright.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-dateCopyrighted DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.dateSubmitted&lt;br /&gt;
| Date of submission of the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-dateSubmitted DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.description&lt;br /&gt;
| An account of the resource. Description may include but is not&lt;br /&gt;
limited to: an abstract, a table of contents, a graphical representation, or a free-text account of the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-description DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| HTML built-in keyword &amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt; &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.educationLevel&lt;br /&gt;
| A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-educationLevel DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.extent&lt;br /&gt;
| The size or duration of the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-extent DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.format&lt;br /&gt;
| The file format, physical medium, or dimensions of the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-format DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.hasFormat&lt;br /&gt;
| A related resource that is substantially the same as the pre-existing described resource, but in another format.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-hasFormat DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| The HTML link type keyword &amp;quot;alternate&amp;quot; used with &amp;quot;link&amp;quot; element:&amp;lt;code&amp;gt;rel=&amp;quot;alternate&amp;quot; type=&amp;quot;URI of related resource&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.hasPart&lt;br /&gt;
| A related resource that is included either physically or logically in the described resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-hasPart DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
 &lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.hasVersion&lt;br /&gt;
| A related resource that is a version, edition, or adaptation of the described resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-hasVersion DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| The HTML link type keyword &amp;quot;alternate&amp;quot; used with &amp;quot;link&amp;quot; element:&amp;lt;code&amp;gt;rel=&amp;quot;alternate&amp;quot; type=&amp;quot;URI of related resource&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.identifier&lt;br /&gt;
| An unambiguous reference to the resource within a given context.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-identifier DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.instructionalMethod&lt;br /&gt;
| A process used to engender knowledge, attitudes and skills, that the described resource is designed to support.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-instructionalMethod DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.isFormatOf&lt;br /&gt;
| A related resource that is substantially the same as the described resource, but in another format.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-isFormatOf DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| The HTML link type keyword &amp;quot;alternate&amp;quot; used with &amp;quot;link&amp;quot; element:&amp;lt;code&amp;gt;rel=&amp;quot;alternate&amp;quot; type=&amp;quot;URI of related resource&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.isPartOf&lt;br /&gt;
| A related resource in which the described resource is physically or logically included.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-isPartOf DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.isReferencedBy&lt;br /&gt;
| A related resource that references, cites, or otherwise points to the described resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-isReferencedBy DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.isReplacedBy&lt;br /&gt;
| A related resource that supplants, displaces, or supersedes the described resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-isReplacedBy DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.isRequiredBy&lt;br /&gt;
| A related resource that requires the described resource to support its function, delivery, or coherence.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-isRequiredBy DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.issued&lt;br /&gt;
| Date of formal issuance (e.g., publication) of the resource. (DC&lt;br /&gt;
doesn&#039;t spec a date format but the established practice is&lt;br /&gt;
YYYY-MM-DD.)&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-issued DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;time pubdate&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.isVersionOf&lt;br /&gt;
| A related resource of which the described resource is a version, edition, or adaptation.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-isVersionOf DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| The HTML link type keyword &amp;quot;alternate&amp;quot; used with &amp;quot;link&amp;quot; element:&amp;lt;code&amp;gt;rel=&amp;quot;alternate&amp;quot; type=&amp;quot;URI of related resource&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.language&lt;br /&gt;
| A language of the resource. Recommended best practice is to use a&lt;br /&gt;
controlled vocabulary such as RFC 4646 [RFC4646].&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-language DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| Redundant with the &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute on the&lt;br /&gt;
&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt; element. (Browsers pay attention to the &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute but not &amp;lt;code&amp;gt;dcterms.language&amp;lt;/code&amp;gt;)&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.license&lt;br /&gt;
| A legal document giving official permission to do something with the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-license DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| The HTML element &amp;lt;code&amp;gt;license&amp;lt;/code&amp;gt;&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.mediator&lt;br /&gt;
| An entity that mediates access to the resource and for whom the resource is intended or useful.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-mediator DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.medium&lt;br /&gt;
| The material or physical carrier of the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-medium DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.modified&lt;br /&gt;
| Date on which the resource was changed. (DC doesn&#039;t spec a date&lt;br /&gt;
format but the established practice is YYYY-MM-DD.)&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-modified DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
|&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.provenance&lt;br /&gt;
| A statement for any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-provenance DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.publisher&lt;br /&gt;
| An entity responsible for making the resource available.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-publisher DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.references&lt;br /&gt;
| A related resource that is referenced, cited, or otherwise pointed to by the described resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-references DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.relation&lt;br /&gt;
| A related resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-relation DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.replaces&lt;br /&gt;
| A related resource that is supplanted, displaced, or superseded by the described resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-replaces DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.requires&lt;br /&gt;
| A related resource that is required by the described resource to support its function, delivery, or coherence.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-requires DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.rights&lt;br /&gt;
| Information about rights held in and over the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-rights DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.rightsHolder&lt;br /&gt;
| A person or organization owning or managing rights over the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-rightsHolder DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.source&lt;br /&gt;
| A related resource from which the described resource is derived.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-source DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.spatial&lt;br /&gt;
| Spatial characteristics of the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-spatial DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.subject&lt;br /&gt;
| The topic of the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-subject DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| HTML built-in keyword &amp;lt;code&amp;gt;keywords&amp;lt;/code&amp;gt;&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.tableOfContents&lt;br /&gt;
| A list of subunits of the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-tableOfContents DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.temporal&lt;br /&gt;
| Temporal characteristics of the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-temporal DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.title&lt;br /&gt;
| A name given to the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-title DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| The HTML element &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt;&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.type&lt;br /&gt;
| The nature or genre of the resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-type DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| dcterms.valid&lt;br /&gt;
| Date (often a range) of validity of a resource.&lt;br /&gt;
| [http://dublincore.org/documents/dcmi-terms/#terms-valid DCMI Metadata Terms] mapped according to&lt;br /&gt;
[http://dublincore.org/documents/dc-html/ Expressing Dublin Core metadata using HTML/XHTML meta and link elements]&lt;br /&gt;
|&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| designer&lt;br /&gt;
| Credits the designer(s) responsible for the visual presentation of a website.&lt;br /&gt;
| [https://sites.google.com/site/metadesignerspec/ Documentation]&lt;br /&gt;
|&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| entity&lt;br /&gt;
| Allows for definitions of XML-style entities for substitution of references (defined as specially-named elements (e.g., use of data element and/or data-* attribute) or script tags) via inclusion of a JavaScript library. Library also supports inclusion of additional meta element entity definitions via iframe documents.&lt;br /&gt;
| [https://github.com/brettz9/js-css-entities Documentation]&lt;br /&gt;
|&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| EssayDirectory&lt;br /&gt;
| Defines a custom description of websites listed in EssayDirectory.&amp;lt;br&amp;gt;Example:&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;EssayDirectory&amp;quot; content=&amp;quot;Helping students find legitimate essay services.&amp;quot;&amp;gt;&lt;br /&gt;
| [http://essaydirectory.com/privacy-terms/#EssayDirectory_MetaExtension Documentation]&lt;br /&gt;
|&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| publisher&lt;br /&gt;
| Searching for one content publisher&#039;s or page publisher&#039;s work requires a standard robot-parsable format for the information. This often differs from creator or author when the publisher is an institution. An institutional name, personal name, or other text entry is permissible.&amp;lt;br /&amp;gt;One element represents only one publisher. Multiple publishers are to be represented with multiple tags, although multiple publishers are less common than multiple authors or creators; multiplicity is more likely for a legal name and a well-known name.&amp;lt;br /&amp;gt;Search engines may index by any component of a name, so a publisher need only enter a name once in one order.&lt;br /&gt;
| defacto standard, used in nearly every website, e.g. [http://www.gaijin.at/olsmgen.php][http://developers.evrsoft.com/metagen.shtml][http://www.html-seminar.de/metatags.htm]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| review_date&lt;br /&gt;
| The date a resource is scheduled for review by content creator in order to determine if it should be archived, updated or retained as is.&lt;br /&gt;
| [http://www.hc-sc.gc.ca/home-accueil/alt_formats/pacrb-dgapcr/pdf/Metadata_Application_Profile_2009.pdf Health Canada Web Metadata Application Profile March 2009 ]&lt;br /&gt;
|&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| es.title&lt;br /&gt;
| Object Title, where this is not the TITLE or H1 tag content, but the resource title&lt;br /&gt;
| [http://www.eibs.co.uk/reference/ EIBS EasySite CMS - Content Attributes Reference]&lt;br /&gt;
| dcterms.title&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| format-detection&lt;br /&gt;
| Enables or disables automatic detection of possible phone numbers in a webpage in Safari on iOS.&lt;br /&gt;
| [http://developer.apple.com/library/safari/#documentation/appleapplications/reference/SafariHTMLRef/Articles/MetaTags.html Apple Safari HTML Reference]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| geo.position&lt;br /&gt;
| Geographic position to which the page is related.&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;geo.position&amp;quot; content=&amp;quot;48.02682000000001;7.809769999999958&amp;quot;&amp;gt;&lt;br /&gt;
| [http://tools.ietf.org/html/draft-daviel-html-geo-tag-08 IETF Draft]&amp;lt;br&amp;gt;[http://geotags.com/geo/geotags2.html GeoTags.com]&lt;br /&gt;
| icbm (different value syntax)&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| geo.country&lt;br /&gt;
| Case-insensitive ISO 3166-1 alpha-2 code of a country to which the page is related.&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;geo.country&amp;quot; content=&amp;quot;de&amp;quot;&amp;gt;&lt;br /&gt;
| [http://tools.ietf.org/html/draft-daviel-html-geo-tag-08 IETF Draft]&amp;lt;br&amp;gt;[http://geotags.com/geo/geotags2.html GeoTags.com]&amp;lt;br&amp;gt;[http://en.wikipedia.org/wiki/ISO_3166-2 ISO-3166-2]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| geo.a1&lt;br /&gt;
| National subdivision (state, canton, region, province, prefecture) of civil address to which the page is related. For resources within the US and Canada, corresponds to the common 2-character State/Province codes.&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;geo.a1&amp;quot; content=&amp;quot;AB&amp;quot;&amp;gt;&lt;br /&gt;
| [http://tools.ietf.org/html/draft-daviel-html-geo-tag-08 IETF Draft]&amp;lt;br&amp;gt;[http://geotags.com/geo/geotags2.html GeoTags.com]&amp;lt;br&amp;gt;RFC 4776&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| geo.a2&lt;br /&gt;
| County, parish, gun (JP), district (IN) of civil address to which the page is related.&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;geo.a2&amp;quot; content=&amp;quot;Warwickshire&amp;quot;&amp;gt;&lt;br /&gt;
| [http://tools.ietf.org/html/draft-daviel-html-geo-tag-08 IETF Draft]&amp;lt;br&amp;gt;[http://geotags.com/geo/geotags2.html GeoTags.com]&amp;lt;br&amp;gt;RFC 4776&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| geo.a3&lt;br /&gt;
| City, township, shi (JP) of civil address to which the page is related.&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;geo.a3&amp;quot; content=&amp;quot;Calgary&amp;quot;&amp;gt;&lt;br /&gt;
| [http://tools.ietf.org/html/draft-daviel-html-geo-tag-08 IETF Draft]&amp;lt;br&amp;gt;[http://geotags.com/geo/geotags2.html GeoTags.com]&amp;lt;br&amp;gt;RFC 4776&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| geo.lmk&lt;br /&gt;
| A landmark or vanity address to which the page is related.&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;geo.lmk&amp;quot; content=&amp;quot;Auwaldstraße 11, 79110 Freiburg im Breisgau, Deutschland&amp;quot;&amp;gt;&lt;br /&gt;
| [http://tools.ietf.org/html/draft-daviel-html-geo-tag-08 IETF Draft]&amp;lt;br&amp;gt;[http://geotags.com/geo/geotags2.html GeoTags.com]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| geo.region&lt;br /&gt;
| Superseded by either geo.country alone or geo.country plus geo.a1. Name of geographic region to which the page is related. Content is specified by ISO-3166.&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;geo.region&amp;quot; content=&amp;quot;DE-BW&amp;quot;&amp;gt;&lt;br /&gt;
| [http://tools.ietf.org/html/draft-daviel-html-geo-tag-08 IETF Draft]&amp;lt;br&amp;gt;[http://geotags.com/geo/geotags2.html GeoTags.com]&amp;lt;br&amp;gt;[http://en.wikipedia.org/wiki/ISO_3166 ISO-3166]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| geo.placename&lt;br /&gt;
| Superseded by geo.lmk. Name of geographic place to which the page is related.&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;geo.placename&amp;quot; content=&amp;quot;London, Ontario&amp;quot;&amp;gt;&lt;br /&gt;
| [http://tools.ietf.org/html/draft-daviel-html-geo-tag-08 IETF Draft]&amp;lt;br&amp;gt;[http://geotags.com/geo/geotags2.html GeoTags.com]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| google-site-verification&lt;br /&gt;
| Used to verify ownership for Webmaster Tools.&lt;br /&gt;
| [http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;amp;answer=79812 Google documentation]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| verify-v1&lt;br /&gt;
| Superseded by google-site-verification. Legacy verification for Google Sitemaps.&lt;br /&gt;
| [http://sitemaps.blogspot.com/2006/05/more-about-meta-tag-verification.html Inside Google Sitemaps: More about meta tag verification]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| googlebot&lt;br /&gt;
| Synonym of &amp;lt;code&amp;gt;robots&amp;lt;/code&amp;gt; for targeting Googlebot only.&lt;br /&gt;
| [http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;amp;answer=93710 Google documentation]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| revisit-after&lt;br /&gt;
| revisit-after is used to tell search engines how often to recrawl the page. To our knowledge only one search engine has ever supported it, and that search engine was never widely used — at this point, it is nothing more than a good luck charm.&lt;br /&gt;
| [http://code.google.com/webstats/2005-12/metadata.html Google documentation]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| icbm&lt;br /&gt;
| Defines geographic position to which page is related to. The acronym stands for ICBM Intercontinental Ballistic Missile - an old, humorous allusion to the possible use of such coordinates.&amp;lt;br&amp;gt;Example:&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;ICBM&amp;quot; content=&amp;quot;47.0667, 15.4500&amp;quot; /&amp;gt;&lt;br /&gt;
| [http://geourl.org/add.html GeoURL documentation]&lt;br /&gt;
| geo.position (different value syntax)&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| HandheldFriendly&lt;br /&gt;
| Denotes handheld-friendly content&lt;br /&gt;
| [http://learnthemobileweb.com/tag/handheldfriendly/]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| markosweb.com/validation&lt;br /&gt;
| Used to verify ownership of Markosweb.com&lt;br /&gt;
| [http://www.markosweb.com/help/ownership/ Markosweb Validation Help]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| MobileOptimized&lt;br /&gt;
| Denotes content optimized for mobile browsers&lt;br /&gt;
| [http://learnthemobileweb.com/tag/mobileoptimized/]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| itemsPerPage&lt;br /&gt;
| Used to identify the number of search results returned per page.&lt;br /&gt;
| [http://www.opensearch.org/Specifications/OpenSearch/1.1#Response_metadata_in_HTML.2FXHTML OpenSearch Specification]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| msapplication-task&lt;br /&gt;
| &#039;&#039;&#039;&amp;quot;Jump List&amp;quot; or &amp;quot;Pinned Sites&amp;quot; in Windows 7&#039;&#039;&#039;&lt;br /&gt;
Jump List items act as entry points into the website even when the browser is not running. A Jump List can contain commonly used destinations and tasks. Some items apply to the whole site, and some apply only to specific users. &lt;br /&gt;
For example, to add a single task called &amp;quot;Check Order Status&amp;quot; specify a meta element in the head of your webpage, as follows:&lt;br /&gt;
 &amp;lt;META name=&amp;quot;msapplication-task&amp;quot; content=&amp;quot;name=Check Order Status;&lt;br /&gt;
      action-uri=./orderStatus.aspx?src=IE9;&lt;br /&gt;
      icon-uri=./favicon.ico&amp;quot;  /&amp;gt;&lt;br /&gt;
| [http://msdn.microsoft.com/en-us/library/gg491725(v=vs.85).aspx Tasks in Jump List]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| msapplication-starturl&lt;br /&gt;
| &#039;&#039;&#039;&amp;quot;Jump List&amp;quot; or &amp;quot;Pinned Sites&amp;quot; in Windows 7&#039;&#039;&#039;&lt;br /&gt;
The &amp;quot;msapplication-starturl&amp;quot; metadata contains the root URL of the application. The start URL can be fully qualified, or relative to the current document. Only HTTP and HTTPS protocols are allowed. If this element is missing, the address of the current page is used instead.&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;msapplication-starturl&amp;quot; content=&amp;quot;./&amp;quot; /&amp;gt;&lt;br /&gt;
| [http://msdn.microsoft.com/en-us/library/gg491732(v=VS.85).aspx Declaring Pinned Site Metadata]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| msapplication-tooltip&lt;br /&gt;
| &#039;&#039;&#039;&amp;quot;Jump List&amp;quot; or &amp;quot;Pinned Sites&amp;quot; in Windows 7&#039;&#039;&#039;&lt;br /&gt;
The &amp;quot;msapplication-tooltip&amp;quot; metadata provides additional tooltip text that appears when you hover over the Pinned Site shortcut in the Windows Start menu or on the desktop.&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;msapplication-tooltip&amp;quot; content=&amp;quot;Channel 9 Podcasts&amp;quot; /&amp;gt;&lt;br /&gt;
| [http://msdn.microsoft.com/en-us/library/gg491732(v=VS.85).aspx Declaring Pinned Site Metadata]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| msapplication-navbutton-color&lt;br /&gt;
| &#039;&#039;&#039;&amp;quot;Jump List&amp;quot; or &amp;quot;Pinned Sites&amp;quot; in Windows 7&#039;&#039;&#039;&lt;br /&gt;
The &amp;quot;msapplication-navbutton-color&amp;quot; metadata define the custom color of the Back and Forward buttons in the Pinned Site browser window. Any named color, or hex color value is valid.&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;msapplication-navbutton-color&amp;quot; content=&amp;quot;#FF3300&amp;quot; /&amp;gt;&lt;br /&gt;
| [http://msdn.microsoft.com/en-us/library/gg491732(v=VS.85).aspx Declaring Pinned Site Metadata]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| msapplication-window&lt;br /&gt;
| &#039;&#039;&#039;&amp;quot;Jump List&amp;quot; or &amp;quot;Pinned Sites&amp;quot; in Windows 7&#039;&#039;&#039;&lt;br /&gt;
The &amp;quot;msapplication-window&amp;quot; metadata sets the initial size of the Pinned Site window when it is launched for the first time. However, if the user adjusts the size of the window, the Pinned Site retains the new dimensions when it is launched again.&lt;br /&gt;
The following properties can be used in the value of the &amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt; attribute:&lt;br /&gt;
* width - The window width in pixels. The minimum value is 800.&lt;br /&gt;
* height - The window height in pixels. The minimum value is 600.&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;msapplication-window&amp;quot; content=&amp;quot;width=1024;height=768&amp;quot; /&amp;gt;&lt;br /&gt;
| [http://msdn.microsoft.com/en-us/library/gg491732(v=VS.85).aspx Declaring Pinned Site Metadata]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| msvalidate.01&lt;br /&gt;
| One of the verification elements used by Bing.&lt;br /&gt;
| [http://onlinehelp.microsoft.com/en-us/bing/hh204490.aspx Bing Webmaster Tools]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:audio&lt;br /&gt;
| A URL to an audio file to accompany this object.&lt;br /&gt;
| [http://ogp.me/ The Open Graph protocol]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:description&lt;br /&gt;
| A one to two sentence description of your object.&lt;br /&gt;
| [http://ogp.me/ The Open Graph protocol]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:determiner&lt;br /&gt;
| The word that appears before this object&#039;s title in a sentence. An enum of (a, an, the, &amp;quot;&amp;quot;, auto). If auto is chosen, the consumer of your data should chose between &amp;quot;a&amp;quot; or &amp;quot;an&amp;quot;. Default is &amp;quot;&amp;quot; (blank).&lt;br /&gt;
| [http://ogp.me/ The Open Graph protocol]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:image&lt;br /&gt;
| An image URL which should represent your object within the graph.&lt;br /&gt;
| [http://ogp.me/ The Open Graph protocol]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:locale&lt;br /&gt;
| The locale these tags are marked up in. Of the format language_TERRITORY. Default is en_US.&lt;br /&gt;
| [http://ogp.me/ The Open Graph protocol]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:locale:alternate&lt;br /&gt;
| An array of other locales this page is available in.&lt;br /&gt;
| [http://ogp.me/ The Open Graph protocol]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:site_name&lt;br /&gt;
| If your object is part of a larger web site, the name which should be displayed for the overall site. e.g., &amp;quot;IMDb&amp;quot;.&lt;br /&gt;
| [http://ogp.me/ The Open Graph protocol]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:title&lt;br /&gt;
| The title of your object as it should appear within the graph, e.g., &amp;quot;The Rock&amp;quot;.&lt;br /&gt;
| [http://ogp.me/ The Open Graph protocol]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:type&lt;br /&gt;
| The type of your object, e.g., &amp;quot;video.movie&amp;quot;. Depending on the type you specify, other properties may also be required.&lt;br /&gt;
| [http://ogp.me/ The Open Graph protocol]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:url&lt;br /&gt;
| The canonical URL of your object that will be used as its permanent ID in the graph, e.g., &amp;quot;http://www.imdb.com/title/tt0117500/&amp;quot;.&lt;br /&gt;
| [http://ogp.me/ The Open Graph protocol]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:video&lt;br /&gt;
| A URL to a video file that complements this object.&lt;br /&gt;
| [http://ogp.me/ The Open Graph protocol]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| norton-safeweb-site-verification&lt;br /&gt;
| Used to verify ownership of Website for Norton SafeWeb.&lt;br /&gt;
| [http://safeweb.norton.com/help/site_owners#verification_tips Norton SafeWeb Help Documentation]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| rating &lt;br /&gt;
| The Restricted to Adults label (RTA) provides a way for adult oriented websites to indicate that their content is off limits to children. RTA was introduced in 2006 and is currently used by a large number of adult web content providers. RTA is recognized by all major parental control filters.&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;RATING&amp;quot; content=&amp;quot;RTA-5042-1996-1400-1577-RTA&amp;quot; /&amp;gt;&lt;br /&gt;
| [http://www.rtalabel.org/index.php?content=howto RTA documentation]&lt;br /&gt;
|&lt;br /&gt;
| Proposal&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| referrer&lt;br /&gt;
| Controls whether the user agent includes the Referer header in HTTP requests originating from this document&lt;br /&gt;
| [http://wiki.whatwg.org/wiki/Meta_referrer Meta referrer]&lt;br /&gt;
|&lt;br /&gt;
| Proposal&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| rights-standard&lt;br /&gt;
| The purpose is to enable search engines and other cataloging services to compile the types of rights allocated to the work. (Does any search engine actually implement this? [[User:Hsivonen|hsivonen]] 07:34, 14 July 2011 (UTC))&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This keyword does not provide, remove or alter any legal protections or designations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Format: &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;meta name=&amp;quot;rights-standard&amp;quot; content=&amp;quot;element id;rights&amp;quot; /&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* element id - the HTML Element ID of the item these rights apply to&lt;br /&gt;
* rights - what rights are assigned to the item&lt;br /&gt;
** &amp;quot;pd&amp;quot; - Public domain&lt;br /&gt;
** &amp;quot;cc by-sa&amp;quot; - Creative Commons Attribution&lt;br /&gt;
** &amp;quot;cc by-nd&amp;quot; - Creative Commons  NoDerivs &lt;br /&gt;
** &amp;quot;cc by-nc&amp;quot; - Creative Commons Attribution-NonCommercial&lt;br /&gt;
** &amp;quot;cc by-nc-sa&amp;quot; - Creative Commons Attribution-NonCommercial-ShareAlike&lt;br /&gt;
** &amp;quot;cc by-nc-nd&amp;quot; - Creative Commons Attribution-NonCommercial-NoDerivs&lt;br /&gt;
&lt;br /&gt;
| [http://sites.google.com/site/metarightsstandard/ Spec]&lt;br /&gt;
|Redundant with [http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#licensing-works Microdata vocabulary for licensing works].&lt;br /&gt;
|Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| robots&lt;br /&gt;
| A comma-separated list of operators explaining how search engine crawlers should treat the content. Possible values are &amp;quot;noarchive&amp;quot; to prevent cached versions, &amp;quot;noindex&amp;quot; to prevent indexing, and &amp;quot;nofollow&amp;quot; works as the link rel value with the same name. This meta name is already supported by every popular search engine.&amp;lt;br /&amp;gt;The content value &amp;quot;NOODP&amp;quot; has been offered elsewhere, so I&#039;m proposing it here. It blocks robots from using [http://www.dmoz.org Open Directory Project] descriptions of a website instead of Web pages&#039; own meta descriptions. It may have been introduced by Microsoft.&amp;lt;br /&amp;gt;The content value &amp;quot;NOYDIR&amp;quot; has been offered by Yahoo, so I&#039;m proposing it here. It blocks Yahoo&#039;s robot from using the Yahoo directory&#039;s descriptions of a website instead of Web pages&#039; own meta descriptions. Whether any other robot supports this is unknown but possibly no other search engine uses Yahoo&#039;s directory anyway.&lt;br /&gt;
| [http://www.robotstxt.org/wc/exclusion.html#meta Robots exclusion protocol], NOODP value: [http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;amp;answer=35264 Google], [http://help.yahoo.com/l/us/yahoo/search/indexing/indexing-11.html Yahoo], NOYDIR value: [http://ysearchblog.com/2007/02/28/yahoo-search-support-for-noydir-meta-tags-and-weather-update/ Yahoo], as accessed 4-28-09&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| skype_toolbar&lt;br /&gt;
| Prevents the Skype browser extension from automatically seeking through the page and replacing telephone numbers (or any number the program&#039;s algorithm thinks is a telephone number) with its own custom presentation that allows direct invocation of the Skype program to call the telephone number.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;skype_toolbar&amp;quot; content=&amp;quot;skype_toolbar_parser_compatible&amp;quot; /&amp;gt;&lt;br /&gt;
| [http://skype.otherlinks.co.uk/page.asp?id=toolbar_number_formatting Skype Info]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| slurp&lt;br /&gt;
| Synonym of &amp;lt;code&amp;gt;robots&amp;lt;/code&amp;gt; for targeting Yahoo! only.&lt;br /&gt;
| [http://help.yahoo.com/l/au/yahoo7/search/indexing/indexing-11.html Yahoo! documentation]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| startIndex&lt;br /&gt;
| Used to identify the index of the first search result in the current set of search results.&lt;br /&gt;
| [http://www.opensearch.org/Specifications/OpenSearch/1.1#Response_metadata_in_HTML.2FXHTML OpenSearch Specification]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| teoma&lt;br /&gt;
| Synonym of &amp;lt;code&amp;gt;robots&amp;lt;/code&amp;gt; for targeting Teoma and Ask.com only.&lt;br /&gt;
| [http://about.ask.com/en/docs/about/webmasters.shtml Ask.com documentation]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| totalResults&lt;br /&gt;
| Used to identify the number of search results available for the current search.&lt;br /&gt;
| [http://www.opensearch.org/Specifications/OpenSearch/1.1#Response_metadata_in_HTML.2FXHTML OpenSearch Specification]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| &amp;lt;span id=&amp;quot;viewport&amp;quot;&amp;gt;viewport&amp;lt;/span&amp;gt;&lt;br /&gt;
| Provides a way for documents to specify (using markup rather than CSS) the size, zoom factor, and orientation of the viewport that is used as the base for the document&#039;s [http://www.w3.org/TR/CSS21/visudet.html#containing-block-details initial containing block]. The following properties can be used in the value of the &amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt; attribute:&lt;br /&gt;
* width&lt;br /&gt;
* height&lt;br /&gt;
* initial-scale&lt;br /&gt;
* minimum-scale&lt;br /&gt;
* maximum-scale&lt;br /&gt;
* user-scalable&lt;br /&gt;
Examples:&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;initial-scale=1.0&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=480, initial-scale=2.0, user-scalable=1&amp;quot;&amp;gt;&lt;br /&gt;
For more details, see the [http://dev.w3.org/csswg/css-device-adapt/#viewport-meta-element Viewport META element] section of the [http://dev.w3.org/csswg/css-device-adapt/ CSS Device Adaptation] draft specification.&lt;br /&gt;
| For &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; elements that have a &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; attribute whose value is &amp;lt;code&amp;gt;viewport&amp;lt;/code&amp;gt;, the [http://dev.w3.org/csswg/css-device-adapt/ CSS Device Adaptation] draft specification defines the recognized properties for the &amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt; attribute&amp;gt;, as well as an algorithm for parsing the value of that attribute.&lt;br /&gt;
|&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| wt.cg_n&lt;br /&gt;
| &#039;&#039;&#039;Name of the Content Group&#039;&#039;&#039;&lt;br /&gt;
Used to configure the appropriate Webtrends advanced feature. These are just some of the more popular ones. These appear in your META tags.  – showing you the web page, the source (meta tag), the log files entry and the subsequent WT report.&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;wt.cg_n&amp;quot; content=&amp;quot;My content&amp;quot;&amp;gt;&lt;br /&gt;
| [http://product.webtrends.com/WRC/OnDemand/ResourceCenter/rc/Library/PDF/IGOD/WebTrendsAnalyticsOnDemandImplementationGuide.pdf Webtrends Parameters]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| wt.cg_s&lt;br /&gt;
| &#039;&#039;&#039;Name of Content Sub-Group&#039;&#039;&#039;&lt;br /&gt;
Used to configure the appropriate Webtrends advanced feature. These are just some of the more popular ones. These appear in your META tags.  – showing you the web page, the source (meta tag), the log files entry and the subsequent WT report.&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;wt.cg_s&amp;quot; content=&amp;quot;My content&amp;quot;&amp;gt;&lt;br /&gt;
| [http://product.webtrends.com/WRC/OnDemand/ResourceCenter/rc/Library/PDF/IGOD/WebTrendsAnalyticsOnDemandImplementationGuide.pdf Webtrends Parameters]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| wt.ac&lt;br /&gt;
| &#039;&#039;&#039;Advertising Click parameter&#039;&#039;&#039;&lt;br /&gt;
When a visitor to your site clicks on an ad, that action is referred to as an Ad Click. The following META tag tracks advertising clicks:&lt;br /&gt;
 &amp;lt;META NAME=&amp;quot;WT.ac&amp;quot; CONTENT=&amp;quot;name&amp;quot;&amp;gt;&lt;br /&gt;
Defines the name of the advertisement clicked to reach a particular web page. The Ad Click must contain an external redirect back to the client. The redirect needs to include the necessary code to generate a hit to the SDC server. You can designate multiple Advertising Clicks using semicolons.&lt;br /&gt;
Examples:&lt;br /&gt;
 &amp;lt;a href=&amp;quot;file111.html?WT.ac=CONTENT111&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;a href=&amp;quot;file222.html?WT.ac=CONTENT222&amp;quot;&amp;gt;&lt;br /&gt;
The name of the advertisement clicked to reach a particular web page. To capture this information with DCS, the Advertising Click must contain an external redirect back to the client. The redirect needs to &lt;br /&gt;
&lt;br /&gt;
include the necessary code to generate a hit to the DCS. The maximum length for each name is 64 bytes.&lt;br /&gt;
| [http://product.webtrends.com/WRC/OnDemand/ResourceCenter/rc/Library/PDF/IGOD/WebTrendsAnalyticsOnDemandImplementationGuide.pdf Webtrends Parameters]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| wt.ad&lt;br /&gt;
| &#039;&#039;&#039;Advertising View parameter&#039;&#039;&#039;&lt;br /&gt;
Visitors often view advertisements that they do not necessarily click on. You can use On-Site Advertising to determine the number of visitors to your web site who view particular ads. With this feature you can produce advertising reports for each of your clients.&lt;br /&gt;
If you are selling advertising space on your web site, for example, you can collect traffic statistics to help determine pricing schedules.&lt;br /&gt;
The following META tag tracks advertising views:&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;WT.ad&amp;quot; content=&amp;quot;My content&amp;quot;&amp;gt;&lt;br /&gt;
An Ad View occurs when a visitor views a page containing an ad. An ad is a link or graphic that contains an Ad Click parameter in the query portion of it&#039;s URL.&lt;br /&gt;
| [http://product.webtrends.com/WRC/OnDemand/ResourceCenter/rc/Library/PDF/IGOD/WebTrendsAnalyticsOnDemandImplementationGuide.pdf Webtrends Parameters]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| wt.mc_id&lt;br /&gt;
| &#039;&#039;&#039;Identifies the ID of the marketing campaign&#039;&#039;&#039;&lt;br /&gt;
To attract new students, a university launches a marketing campaign by sending recruitment email to all graduating high school seniors in a metropolitan area. The email links to a special landing page in the university’s web site, containing the following META tag to track marketing campaigns.&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;META NAME=&amp;quot;WT.mc_id&amp;quot; CONTENT=&amp;quot;1X2GG34&amp;quot;&amp;gt;&lt;br /&gt;
You may use this parameter on the URL.&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;a href=&amp;quot;link?WT.mc_id=1X2GG34&amp;quot;&amp;gt;&lt;br /&gt;
The Campaign ID 1X2GG34 represents recruits to be contacted by email&lt;br /&gt;
| [http://product.webtrends.com/WRC/OnDemand/ResourceCenter/rc/Library/PDF/IGOD/WebTrendsAnalyticsOnDemandImplementationGuide.pdf Webtrends Parameters]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| wt.sv&lt;br /&gt;
| &#039;&#039;&#039;Tracking Servers parameter&#039;&#039;&#039;&lt;br /&gt;
If your site is hosted on multiple servers, a server cluster, or a server farm, and you want to evaluate the performance of your load balancer, Webtrends can track page views for each server. To do so, populate the following META tag on all pages on each server:&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;WT.sv&amp;quot; content=&amp;quot;My Server&amp;quot;&amp;gt;&lt;br /&gt;
Defines the name of the machine that serves the web page. If you have two servers (Server1 and Server2), you would make two copies of the META tag and designate CONTENT=“Server1” for deployment to pages on the first server and CONTENT=“Server2” for deployment to the same pages on the second server.&lt;br /&gt;
For a server farm, you can extract the value of the built-in server name and dynamically assign it to the&lt;br /&gt;
META tag using server-side scripting.&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;WT.sv&amp;quot; content=&amp;quot;Server1&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;WT.sv&amp;quot; content=&amp;quot;Server2&amp;quot;&amp;gt;&lt;br /&gt;
An Ad View occurs when a visitor views a page containing an ad. An ad is a link or graphic that contains an Ad Click parameter in the query portion of it&#039;s URL.&lt;br /&gt;
| [https://tagbuilder.webtrends.com/Help/Miscellaneous/AdSearch.aspx?keepThis=true&amp;amp;TB_iframe=true&amp;amp;height=450&amp;amp;width=650 About WT.ad].&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| wt.ti&lt;br /&gt;
| &#039;&#039;&#039;Tracking Page Titles&#039;&#039;&#039;&lt;br /&gt;
You may want to modify a page title before sending it to Webtrends in the following cases:&lt;br /&gt;
* You are dealing with dynamic content pages identified by URL parameters, and the page title represents the title of the base URL page rather than the dynamic content page.&lt;br /&gt;
Unless you modify the page titles, all pages have the same title in the reports.&lt;br /&gt;
* All pages have been assigned the same title, for reasons of style or company policy.&lt;br /&gt;
Even though URLs are displayed in addition to page title, the entire URL cannot be depended upon to distinguish one page from another.&lt;br /&gt;
Use server-side scripts to change the title to something that reflects the content of the pages so that you can identify them in reports. Next, pass the customized page titles to Webtrends, using the following META tag:&lt;br /&gt;
 &amp;lt;META NAME=&amp;quot;WT.ti&amp;quot; CONTENT=&amp;quot;title&amp;quot;&amp;gt;&lt;br /&gt;
Defines the name of the title for this page.&lt;br /&gt;
| [http://product.webtrends.com/WRC/OnDemand/ResourceCenter/rc/Library/PDF/IGOD/WebTrendsAnalyticsOnDemandImplementationGuide.pdf Webtrends Parameters]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| y_key&lt;br /&gt;
| Used to verify ownership for Yahoo! Site Explorer&lt;br /&gt;
| [http://help.yahoo.com/l/us/yahoo/search/siteexplorer/siteexplorer-06.html Yahoo! documentation]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| yandex-verification&lt;br /&gt;
| Used to verify ownership for Yandex Webmaster.&lt;br /&gt;
| [http://help.yandex.ru/webmaster/?id=995300#995356 Yandex Webmaster ownership verification]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.instruction&lt;br /&gt;
| Globrix property information: Property to Buy or Rent&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.price&lt;br /&gt;
| Globrix property information: Price for the property&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.postcode&lt;br /&gt;
| Globrix property information: Postcode of the property&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.bedrooms&lt;br /&gt;
| Globrix property information: Number of bedrooms the property has&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.bathrooms&lt;br /&gt;
| Globrix property information: Number of bathrooms the property has&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.type&lt;br /&gt;
| Globrix property information: Type of property e.g. &#039;semi-detatched house&#039;&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.condition&lt;br /&gt;
| Globrix property information: Condition of the property e.g. &#039;renovated&#039;&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.features&lt;br /&gt;
| Globrix property information: Features of the property e.g. &#039;double glazing&#039;&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.outsidespace&lt;br /&gt;
| Globrix property information: External features of the property e.g. &#039;garden&#039;&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.parking&lt;br /&gt;
| Globrix property information: Parking available for property e.g. &#039;parking for 2 cars&#039;&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.period&lt;br /&gt;
| Globrix property information: Period of the property e.g. &#039;victorian terrace&#039;&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.poa&lt;br /&gt;
| Globrix property information: If the property price is only available on application&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.tenure&lt;br /&gt;
| Globrix property information: The tenure of the property e.g. &#039;leasehold&#039;&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.underoffer&lt;br /&gt;
| Globrix property information: Indicates if the property is under offer&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.priceproximity&lt;br /&gt;
| Globrix property information: The region of the attached price e.g. &#039;guide price of&#039;&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.latitude&lt;br /&gt;
| Globrix property information: The latitude of the property&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| globrix.longitude&lt;br /&gt;
| Globrix property information: The longitude of the property&lt;br /&gt;
| [http://content.globrix.com/web-tools/8-technical-guide/74-what-are-globrix-meta-tags-and-how-can-i-use-them FAQ About the Globrix meta tags.]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| meta_date&lt;br /&gt;
| The date used to indicate that the Metadata has been prepared and/or reviewed and approved by the Metadata Unit. Its purpose is administrative. (Used by &amp;quot;Autonomy&amp;quot;.)&lt;br /&gt;
| [http://www.hc-sc.gc.ca/home-accueil/alt_formats/pacrb-dgapcr/pdf/Metadata_Application_Profile_2009.pdf Health Canada Web Metadata Application Profile March 2009 ]&lt;br /&gt;
|&lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| Site-Type&lt;br /&gt;
| Used to define the body of the document content type offered&lt;br /&gt;
| [http://programadorweb.net.tc/?page_id=124 Information and values ​​accepted by Metatag]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| wot-verification&lt;br /&gt;
| Used to verify ownership of WOT (Web Of Trust)&lt;br /&gt;
| [http://www.mywot.com/wiki/Verify_your_website WOT&#039;s verify your site wiki page]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| gwt:property&lt;br /&gt;
| Used to specify the locale client property&lt;br /&gt;
| [https://developers.google.com/web-toolkit/doc/latest/DevGuideI18nLocale Locales in GWT]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| mobile-agent&lt;br /&gt;
| Specifies the mobile-compatible url of the web page.  Used by mobile browsers and search engines to redirect mobile phone visitors to the proper mobile page. &amp;lt;br&amp;gt;&lt;br /&gt;
The following properties can be used in the value of the content attribute:&amp;lt;br&amp;gt;url - The mobile-compatible url of the web page.&amp;lt;br&amp;gt;format - The format of the mobile page. An enum of &amp;quot;wml&amp;quot;, &amp;quot;xhtml&amp;quot; and &amp;quot;html5&amp;quot;.&amp;lt;br&amp;gt;Example:&lt;br /&gt;
 &amp;lt;meta name=&amp;quot;mobile-agent&amp;quot; content=&amp;quot;format=html5; url=http://3g.sina.com.cn/&amp;quot;&amp;gt;&lt;br /&gt;
| [http://open.shouji.baidu.com/?page=developer&amp;amp;action=pcandmo Baidu Mobile SEO]&lt;br /&gt;
| &lt;br /&gt;
| Proposal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Proposals that don&#039;t meet the [http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#other-metadata-names requirements] for a registration ==&lt;br /&gt;
&lt;br /&gt;
Note that these proposals can be moved back to the registry table if the problems listed in the rightmost column of this table are addressed.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Keyword&lt;br /&gt;
! Brief description&lt;br /&gt;
! Link to specification&lt;br /&gt;
! Synonyms&lt;br /&gt;
! Status&lt;br /&gt;
! Registration requirement failure&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| gm-gpx-v&lt;br /&gt;
| Wordpress Plugin Google Maps GPX Viewer&lt;br /&gt;
| [http://wordpress.org/extend/plugins/google-maps-gpx-viewer/ Google Maps GPX Viewer]&lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Claimed spec link is not a link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:title&lt;br /&gt;
| Open Graph Protocol by Facebook developers&lt;br /&gt;
| [http://developers.facebook.com/docs/opengraph/ Facebook developers]&lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| The spec specifies this to be a value of the property attribute--not a meta keyword&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:type&lt;br /&gt;
| Open Graph Protocol by Facebook developers&lt;br /&gt;
| [http://developers.facebook.com/docs/opengraph/ Facebook developers]&lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| The spec specifies this to be a value of the property attribute--not a meta keyword&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:url&lt;br /&gt;
| Open Graph Protocol by Facebook developers&lt;br /&gt;
| [http://developers.facebook.com/docs/opengraph/ Facebook developers]&lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| The spec specifies this to be a value of the property attribute--not a meta keyword&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:image&lt;br /&gt;
| Open Graph Protocol by Facebook developers&lt;br /&gt;
| [http://developers.facebook.com/docs/opengraph/ Facebook developers]&lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| The spec specifies this to be a value of the property attribute--not a meta keyword&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:site_name&lt;br /&gt;
| Open Graph Protocol by Facebook developers&lt;br /&gt;
| [http://developers.facebook.com/docs/opengraph/ Facebook developers]&lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| The spec specifies this to be a value of the property attribute--not a meta keyword&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| fb:admins&lt;br /&gt;
| Open Graph Protocol by Facebook developers&lt;br /&gt;
| [http://developers.facebook.com/docs/opengraph/ Facebook developers]&lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| The spec specifies this to be a value of the property attribute--not a meta keyword&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| og:description&lt;br /&gt;
| Open Graph Protocol by Facebook developers&lt;br /&gt;
| [http://developers.facebook.com/docs/opengraph/ Facebook developers]&lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| The spec specifies this to be a value of the property attribute--not a meta keyword&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| fb:page_id&lt;br /&gt;
| Open Graph Protocol by Facebook developers&lt;br /&gt;
| [http://developers.facebook.com/docs/opengraph/ Facebook developers]&lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| The spec specifies this to be a value of the property attribute--not a meta keyword&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| audience&lt;br /&gt;
| To aid search engines in classifying and to aid directory compilers, an audience most appropriate for the page may be suggested. Subject matter may not be a good clue; for example, an analysis of children&#039;s literature may be directed to teachers.&amp;lt;br /&amp;gt;A value is free-form case-insensitive text without a comma. Multiple values are to be comma-separated. Singular and plural forms have the same meaning.&amp;lt;br /&amp;gt;Recognized values:&amp;lt;br /&amp;gt;-- &amp;quot;all&amp;quot; and &amp;quot;everyone&amp;quot;, which have the same meaning&amp;lt;br /&amp;gt;-- &amp;quot;adult&amp;quot; and &amp;quot;mature&amp;quot; have the same meaning and are for content that only adults may access, but no one responsible for preventing a nonadult or the immature from accessing the page or its content should rely on either or both of these values to do so without other means (not the same as &amp;quot;grownup&amp;quot;, which see)&amp;lt;br /&amp;gt;-- &amp;quot;child&amp;quot; and &amp;quot;juvenile&amp;quot;, which have the same meaning&amp;lt;br /&amp;gt;-- &amp;quot;teen&amp;quot;&amp;lt;br /&amp;gt;-- &amp;quot;grownup&amp;quot; is not identical to &amp;quot;adult&amp;quot; or &amp;quot;mature&amp;quot; in not implying a precise boundary but is approximately any person who may be able to understand and apply the content (e.g., car driving instruction that may be read by a minor not yet old enough to drive a car but who would likely benefit from somewhat early exposure to the instruction)&amp;lt;br /&amp;gt;-- &amp;quot;parent&amp;quot; to include guardian and temporary caregiver&amp;lt;br /&amp;gt;-- &amp;quot;teacher&amp;quot; to include professor and ad hoc instructor&amp;lt;br /&amp;gt;-- &amp;quot;elementary school student&amp;quot; to include any student below high school&amp;lt;br /&amp;gt;-- &amp;quot;high school student&amp;quot;&amp;lt;br /&amp;gt;-- &amp;quot;elhi&amp;quot; to include any student in elementary school through high school&amp;lt;br /&amp;gt;-- &amp;quot;college student&amp;quot; including graduate and professional school&amp;lt;br /&amp;gt;-- &amp;quot;business&amp;quot; including management, finance, and prospective customers (this includes e-commerce and investor sites)&amp;lt;br /&amp;gt;-- &amp;quot;health&amp;quot; including any health care provider including alternative and ad hoc&amp;lt;br /&amp;gt;-- &amp;quot;patient&amp;quot; for any health care recipient&amp;lt;br /&amp;gt;-- &amp;quot;lawyer&amp;quot; including judge, paralegal, and jailhouse lawyer&amp;lt;br /&amp;gt;-- &amp;quot;law client&amp;quot; for any prospective recipient of a lawyer&#039;s service (not usually a social work client) with &#039;&#039;lawyer&#039;&#039; including paralegal and jailhouse lawyer but not necessarily judge&amp;lt;br /&amp;gt;-- &amp;quot;craft&amp;quot; for any craftworker including laborer and artisan&amp;lt;br /&amp;gt;-- &amp;quot;artist&amp;quot; including musician, actor, dancer, and sculptor and including creator and performer&amp;lt;br /&amp;gt;-- &amp;quot;military&amp;quot; including paramilitary&amp;lt;br /&amp;gt;-- &amp;quot;news&amp;quot; including any consumer of rapidly-developing news&amp;lt;br /&amp;gt;-- &amp;quot;introductory&amp;quot; and &amp;quot;beginner&amp;quot;, which have the same meaning&amp;lt;br /&amp;gt;-- &amp;quot;intermediate&amp;quot; and &amp;quot;midlevel&amp;quot;, which have the same meaning&amp;lt;br /&amp;gt;-- &amp;quot;advanced&amp;quot; and &amp;quot;advance&amp;quot;, which have the same meaning&amp;lt;br /&amp;gt;-- &amp;quot;scholarly&amp;quot; and &amp;quot;scholar&amp;quot;, which have the same meaning&amp;lt;br /&amp;gt;-- &amp;quot;popular&amp;quot; generally referring to a writing style&amp;lt;br /&amp;gt;-- &amp;quot;older&amp;quot; including retiree&amp;lt;br /&amp;gt;-- &amp;quot;institution&amp;quot; including from corporation to conspiracy (such as for management advice)&amp;lt;br /&amp;gt;-- &amp;quot;government&amp;quot; including agencies and prospective politicians&amp;lt;br /&amp;gt;-- values using any integer or single-digit decimal in the form of &amp;quot;grade 8&amp;quot; or &amp;quot;grade 6.4&amp;quot; including to refer to a reading comprehension level (this generally will not exceed 12 and might be meaningless above 20 so higher values may be interpreted as the highest meaningful value)&amp;lt;br /&amp;gt;-- &amp;quot;viewers&amp;quot; for when content (such as a movie) is intended almost entirely to be seen rather than read&amp;lt;br /&amp;gt;-- &amp;quot;listeners&amp;quot; for when content (such as music) is intended almost entirely to be heard rather than read but not generally including text-to-speech support&amp;lt;br /&amp;gt;-- &amp;quot;tts&amp;quot;, &amp;quot;text-to-speech&amp;quot;, or &amp;quot;text to speech&amp;quot;, which three have the same meaning and which are for a page that has substantial support for TTS or that will be readily understood through TTS without need for such support (TTS is often aided by, e.g., pre-resolving pronunciation ambiguities in page coding)&amp;lt;br /&amp;gt;-- values using any numbers in the form of &amp;quot;3-6 years old&amp;quot;, whether a range or a single-number value&amp;lt;br /&amp;gt;-- values using any decade in the form of &amp;quot;born in 1970s&amp;quot;&amp;lt;br /&amp;gt;Unrecognized values such as &amp;quot;botanists&amp;quot;, &amp;quot;Texans&amp;quot;, and &amp;quot;writers who use red ink&amp;quot; may be used but at a risk that a search engine or directory editor will either fail to recognize it or will interpret it in unpredictable ways, or will in the future.&amp;lt;br /&amp;gt;Spellings that are erroneous or slightly different from a recognized value may be interpreted by a search engine or directory editor as representing a recognized value.&amp;lt;br /&amp;gt;The absence of the keyword defaults to a value of &amp;quot;all&amp;quot; but without overriding another indication arrived at by other means.&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| blogcatalog&lt;br /&gt;
| Used to verify ownership of Blog Catalog.com&lt;br /&gt;
| [http://www.blogcatalog.com/ Blog catalog site]&lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Claimed spec link is not a link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| bot-. . .&lt;br /&gt;
| Robot owners, to allow page authors access to robotic capabilities, e.g., to deny them, should prefix &amp;quot;bot-&amp;quot; to the name of their robot, especially for proprietary bots.&amp;lt;br /&amp;gt;Example: If a robot were to be named &amp;quot;dullbucklequiz&amp;quot;, the name in the meta element would be &amp;quot;bot-dullbucklequiz&amp;quot;.&amp;lt;br /&amp;gt;The value &amp;quot;bot-&amp;quot; alone represents all bots so prefixed, like a wildcard.&amp;lt;br /&amp;gt;Arguably, there&#039;s no need for a list here of any specific bots if http://user-agents.org or http://www.botsvsbrowsers.com/ (and perhaps other sites) is reliable.&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec, tries to register a space of names instead of enumerated names&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| created&lt;br /&gt;
| The datetime at which the document was created. The value is an ISO8601 date. The date MUST follow the [http://www.w3.org/TR/NOTE-datetime W3C Profile of ISO 8601] with a granularity of &amp;quot;Complete date:&amp;quot; or finer. The [http://www.bbc.co.uk/guidelines/futuremedia/desed/previousversions/searchmetadata_vs_1_0.shtml#metadata BBC] use this name.&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| creator&lt;br /&gt;
| The creator is an off-Web or pre-Web creator of a work for which an author authored a Web page, so that the creator and the author may be different people.&amp;lt;br /&amp;gt;Searching for one content creator&#039;s work requires a standard robot-parsable format for the information. A personal name, institutional name, or other text entry is permissible.&amp;lt;br /&amp;gt;One element represents only one creator. Multiple creators are to be represented with multiple tags.&amp;lt;br /&amp;gt;Search engines may index by any component of a name, so a content creator need only enter a name once in one first-last or family-given order (e.g., Pat Thunderbird or Thunderbird, Pat, but not requiring both).&lt;br /&gt;
| [[Talk:MetaExtensions#Re:_Proposed_&#039;creator&#039;_MetaExtension|Talk]]&lt;br /&gt;
|&lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| msnbot&lt;br /&gt;
| Synonym of &amp;lt;code&amp;gt;robots&amp;lt;/code&amp;gt; for targeting Bing only.&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| ia_archive&lt;br /&gt;
| Synonym of &amp;lt;code&amp;gt;robots&amp;lt;/code&amp;gt; for targeting Internet Archive and Alexa only.&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| datetime-coverage&lt;br /&gt;
| The author may be the best expert on which time frame is most relevant to the content. Leaving that to search engine analysis may be too chancy without search engine optimization, which analysis is difficult to apply by algorithm to, e.g., historical papers that may focus on the 1800s but mention 1731 and 1912 perhaps unimportantly.&amp;lt;br /&amp;gt;The value for this keyword is a date or time -- not a range and not vague, for which other keywords are proposed -- in a format in accordance with http://www.w3.org/TR/NOTE-datetime (albeit a note that&#039;s at W3C only for discussion). Any of the six levels of granularity in that note are acceptable, such as expressing only a year.&amp;lt;br /&amp;gt;Should this keyword appear more than  once, all the values so appearing are determinative. Multiple values are to be expressed with separate meta elements lest the note be revised in the future in a way incompatible with comma-separating a list.&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| property=&amp;quot;og:*&amp;quot;&lt;br /&gt;
| Metadata used by the Open Graph protocol (used by Facebook). Note: currently these are defined as: &amp;lt;meta property=&amp;quot;og.*&amp;quot; content=&amp;quot;x&amp;quot;/&amp;gt;&lt;br /&gt;
| [http://developers.facebook.com/docs/opengraph/ FAQ About the Open Graph protocol from Facebook.]&lt;br /&gt;
| &lt;br /&gt;
| Doesn&#039;t belong in this registry&lt;br /&gt;
| Not a value to be used in the &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; attribute&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| datetime-coverage-end&lt;br /&gt;
| This is identical to the keyword datetime-coverage except that it represents only the end. If this keyword is used without datetime-coverage-start (also proposed), its value is interpreted as ending a range without a start.&amp;lt;br /&amp;gt;Should this keyword appear more than once, all the values so appearing are determinative, in which case each represents the end of a different range assumed to be nonnesting. Example: If four elements happen to be in the order of datetime-coverage-end=1865, datetime-coverage-start=1914, datetime-coverage-end=1918, and datetime-coverage-start=1862, assuming proper formatting, the ranges should be interpreted as 1862-1865 and 1914-1918.&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| datetime-coverage-start&lt;br /&gt;
| This is identical to the keyword datetime-coverage except that it represents only the start. If this keyword is used without datetime-coverage-end (also proposed), its value is interpreted as starting a range without an end.&amp;lt;br /&amp;gt;Should this keyword appear more than once, all the values so appearing are determinative, in which case each represents the start of a different range assumed to be nonnesting. Example: If four elements happen to be in the order of datetime-coverage-start=1862, datetime-coverage-start=1914, datetime-coverage-end=1865, and datetime-coverage-end=1918, assuming proper formatting, the ranges should be interpreted as 1862-1865 and 1914-1918.&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| datetime-coverage-vague&lt;br /&gt;
| This is identical to the keyword datetime-coverage except that its value is not necessarily crisp. This keyword should be used only when datetime-coverage, datetime-coverage-start, and datetime-coverage-end are inappropriate, but there&#039;s no ban on using all four. Any text without a comma can be the value (e.g., Pleistocene, 1820s, Tuesdays, or before we were born); multiple values are comma-separated.&amp;lt;br /&amp;gt;If this keyword is used with datetime-coverage, datetime-coverage-start, or datetime-coverage-end, the vague value should be exploited along with the value/s for the other keyword/s.&amp;lt;br /&amp;gt;Should this keyword appear more than once, all are determinative.&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| DC.&lt;br /&gt;
| Dublin Core, maintained by Dublin Core MetaData Initiative (DCMI), is an extensive system with some overlap with non-DC names.&amp;lt;br /&amp;gt;This reserves all strings that begin with DC and a dot. &#039;&#039;Not true; DC-HTML doesn&#039;t use hardwired prefixes, but defines the prefixes using link/@rel=&amp;quot;scheme.prefix&amp;quot;&#039;&#039;&lt;br /&gt;
| [http://www.DublinCore.org DCMI]&lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Tries to register a space of names instead of enumerated names&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| dir-content-pointer&lt;br /&gt;
| When several pages in a directory include main content, a table of contents, an index, and the like, a search engine may be able to organize results more usefully by identifying which is which with a standard vocabulary, helpful when different publishers use different conventions when displaying or printing content.&amp;lt;br /&amp;gt;A value is free-form case-insensitive text without a comma and optionally with a trailing number. Multiple values are to be comma-separated (multiple values are appropriate when one document serves multiple purposes). Singular and plural forms have the same meaning.&amp;lt;br /&amp;gt;Recognized values, which are pointer types to which numbers may be suffixed, are limited to &amp;quot;start&amp;quot; meaning &#039;the first page that should be seen by a user&#039; (this may be anywhere in the directory and anywhere within content), &amp;quot;toc&amp;quot; meaning &#039;table of contents&#039;, &amp;quot;intro&amp;quot; including introductions, forewords, prefaces, and tables of figures, &amp;quot;abstract&amp;quot;, &amp;quot;main&amp;quot;, &amp;quot;bibliography&amp;quot; and &amp;quot;biblio&amp;quot;, which have the same meaning, &amp;quot;index&amp;quot; which may mean &#039;sitemap&#039; or not, &amp;quot;afterword&amp;quot; and &amp;quot;update&amp;quot; which have the same meaning and need not actually update, &amp;quot;credit&amp;quot; meaning &#039;credits and acknowledgments&#039;, and &amp;quot;author bio&amp;quot; meaning &#039;author&#039;s biography&#039;, including any information about the author including credentials and contact information. The number suffix may be spaceless or not.&amp;lt;br /&amp;gt;When numbers are suffixed, a search engine or directory should arrange like items in numerical order in the results, with unnumbered items following like items that are numbered, e.g., intro 1, intro 2, main 1, main 2, main, main, and so on.&amp;lt;br /&amp;gt;Each directory and each subdirectory has its own sequence.&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|expires&lt;br /&gt;
|&amp;lt;code&amp;gt;meta name=&#039;expires&#039;&amp;lt;/code&amp;gt; defines the expiration date of the page. This can be used for web pages in preparation for an upcoming event, e.g. a registration form for an exposition or competition, or other cases with a pre-set date when the document will no longer be valid, e.g. a product offer in a special sale or a support page for a product known not to be supported anymore from a given time onward.&lt;br /&gt;
&lt;br /&gt;
Search engines should respond to this meta tag in a reasonable way, i.e. by removing the page from their main search results after the expiration date (possibly still returning the result in a special search for expired pages as long as the page exists and is not explicitly excluded via &amp;lt;code&amp;gt;robots.txt&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;meta name=&#039;robots&#039;&amp;lt;/code&amp;gt; etc.) or simply by indicating to the user that this result is out-of-date.&lt;br /&gt;
&lt;br /&gt;
The content attribute should define the expiration date in accordance with http://www.w3.org/TR/NOTE-datetime . The meta tag should not be used for pages without expiration date. However, for historical reasons, search engines should also interpret other date formats where possible and should be prepared to find values such as &amp;quot;&amp;quot;, &amp;quot;0&amp;quot;, &amp;quot;no&amp;quot; and &amp;quot;never&amp;quot;. Such non-date values are to be interpreted as no expiration date.&lt;br /&gt;
&lt;br /&gt;
Correctly formatted example:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;meta name=&#039;expires&#039; content=&#039;2012-12-31T23:59Z&#039;&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tag is not to be confused with and has a different meaning than &amp;lt;code&amp;gt;meta http-equiv=&#039;expires&#039;.&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| format-print&lt;br /&gt;
| This is to allow a user agent to inform an operating system or a printer driver of the preferred print medium, such as the paper size.&amp;lt;br /&amp;gt;A value is free-form case-insensitive text without a comma. Multiple values are to be comma-separated (multiple values might be appropriate because standard paper sizes vary around the world). Singular and plural forms have the same meaning.&amp;lt;br /&amp;gt;Recognized values are limited to &amp;quot;letter&amp;quot;, &amp;quot;A4&amp;quot;, &amp;quot;legal&amp;quot;, &amp;quot;A5&amp;quot;, &amp;quot;B5&amp;quot;, &amp;quot;monarch&amp;quot;, &amp;quot;envelope 10&amp;quot; meaning size #10, &amp;quot;envelope 6-3-4&amp;quot; meaning size #6 3/4, values with integers and decimals in the form of &amp;quot;8.5 x 11&amp;quot; or &amp;quot;8.5x11&amp;quot; in which spacing of the &amp;quot;x&amp;quot; does not affect meaning, &amp;quot;paper&amp;quot;, which means &#039;paper of the default color (usually white) and weight (usually 20-lb. stock)&#039;, &amp;quot;white&amp;quot;, &amp;quot;yellow&amp;quot;, &amp;quot;pink&amp;quot;, &amp;quot;blue&amp;quot;, &amp;quot;green&amp;quot;, &amp;quot;violet&amp;quot;, or &amp;quot;multicolor&amp;quot;, which means a medium of the given color or mixed, &amp;quot;letterhead&amp;quot;, &amp;quot;p2 letterhead&amp;quot; meaning &#039;letterhead intended for any page except the first&#039;, &amp;quot;watermark&amp;quot; meaning a &#039;special watermark such as an organization&#039;s own&#039;, and &amp;quot;plain&amp;quot; meaning &#039;not preprinted and not letterhead (it may have a paper manufacturer&#039;s watermark not related to letterhead)&#039;.&amp;lt;br /&amp;gt;Omitting &amp;quot;paper&amp;quot; when another recognized value is given defaults to an implied meaning of &#039;paper&#039; with the other value; e.g., &amp;quot;letter&amp;quot; means &#039;letter paper&#039;; the same principle applies to a medium&#039;s color (the default being white for paper and colorless for transparency) and plainness or lack thereof (the default being plain).&amp;lt;br /&amp;gt;Other values should be proposed before being recognized here. Label sizes should be proposed here for labels that are not on backing sheets that fit one of the recognized values, e.g., labels on narrow rolls. Blueprint paper sizes should be proposed here. Media other than standard paper, such as onion skin, heavier paper, card, and clear or color transparency, should be proposed here.&amp;lt;br /&amp;gt;The user agent may, with the user&#039;s or user sysadmin&#039;s permission (as by a menu-driven default), interpret a value to offer an alternative the user might accept and software and firmware other than the UA may interpret a value to the same end with or without permission, so this keyword is only suggestive; e.g., &amp;quot;letter&amp;quot; may be interpreted as &amp;quot;A4&amp;quot;.&amp;lt;br /&amp;gt;The absence of the keyword defaults to a value determined by other than the page, e.g., by the printer driver or the user agent.&lt;br /&gt;
| [[Talk:MetaExtensions#Re:_Proposed_&#039;format-print&#039;_MetaExtension|Talk]]&lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| geographic-coverage&lt;br /&gt;
| The author may be the best expert on the geographic relevance of the content. Leaving that to search engine analysis may be too chancy without search engine optimization, which analysis is difficult to apply by algorithm to, e.g., historical papers and epidemiological studies which may mention locales only once.&amp;lt;br /&amp;gt;Absence of the keyword defaults to a value of world (not universe), unless the search engine chooses to interpret the page or larger unit for some other value, probably based on other than just contact information given in the website.&amp;lt;br /&amp;gt;The value for this keyword is a semicolon-separated list of one or more place-values, the order of which do not matter. One place-value will use commas to separate, in order, an optional standard natural language symbol applicable to the place-value (when omitted the language applicable to the page will control), a place-class, one or more place-subclasses if any, and one or more place name parts (where, e.g., in &amp;quot;Cape Town, South Africa&amp;quot;, &amp;quot;Cape Town&amp;quot; is a place name part but &amp;quot;Town&amp;quot; is not). Spaces after semicolons and commas are optional; spaces within place-values are present when required for each place-value (e.g., &amp;quot;Quezon City&amp;quot;, not an invented &amp;quot;QuezonCity&amp;quot;).&amp;lt;br /&amp;gt;To distinguish names that might otherwise be too similar, place-classes, all lower-case and hyphenatably spaceless, include &#039;&#039;outer-space&#039;&#039;, &#039;&#039;region&#039;&#039; (on Earth and crossing or larger than a nation, e.g., southern hemisphere, polar region, temperate zone, or Asia), &#039;&#039;intntl-water&#039;&#039; (an &#039;international water body&#039;), &#039;&#039;intntl-agcy&#039;&#039; (&#039;international agency&#039; or &#039;international collection&#039;, e.g., all U.N. member nations), &#039;&#039;nation&#039;&#039;, &#039;&#039;within-nation&#039;&#039; (limited to only one political level down from nation, e.g., state, province, territory, possession, city not included within other political units of a nation, or any comparable unit), &#039;&#039;city&#039;&#039; (including town, village, hamlet, and any comparable political unit below the level of &#039;&#039;within-nation&#039;&#039;), &#039;&#039;addr&#039;&#039; (including address, full-length street, building, institution, and neighborhood without political boundaries), &#039;&#039;pol-unit&#039;&#039; (&#039;&#039;pol&#039;&#039; abbreviating &#039;political&#039;) (e.g., a place of disputed nationhood), &#039;&#039;hist-pol-unit&#039;&#039; (&#039;&#039;hist&#039;&#039; abbreviating &#039;historical&#039;) (e.g., the Roman Empire), &#039;&#039;feature&#039;&#039; (e.g., river), &#039;&#039;num&#039;&#039; (e.g., latitude and longitude or outer-space equivalent in numbers), and &#039;&#039;ethereal&#039;&#039; (including thealogical/theological, fictional including from modern popular entertainment, and ancient secular mythical, but not including that which is asserted to be a state of mind or existence but not a place, such as nirvana). (Example for one hypothetical page: name=&amp;quot;geographic-coverage&amp;quot; content=&amp;quot;region, sub-Saharan Africa; nation, Panama; city, Panama, Panama; within-nation, Sao Paulo, Brazil; city, Sao Paulo, Sao Paulo, Brazil; within-nation, Mississippi, United States of America; region, Middle East; region, Midwest, United States of America; hist-pol-unit, Northwest Territory, United States of America; feature, river, Indus; outer-space, Indus; ethereal, ultima Thule; ethereal, Heaven; ethereal, Flatland; ethereal, Valhalla; en-US, addr, Hotel Valhalla, Fredrikstad, Norway; es, nation, Espana&amp;quot; (Indus is both a river and a constellation, illustrating the need for place-classes)).&amp;lt;br /&amp;gt;Ambiguity of place-values should be avoided despite convenience in coding because search engines may each interpret them as they see fit, e.g., it would be hard for an engine to distinguish New York from New York.&amp;lt;br /&amp;gt;For consistency of spelling, several authority lists should be settled upon, with legal, well-known, and disputed names and common abbreviations all being acceptable; but I&#039;m not proposing one here now (relying on IANA&#039;s ccTLD list might be too complex to implement and still assure coding consistency, e.g., occasionally ccTLDs can be phased out and off of IANA&#039;s list) (a standard vocabulary possibly usable here is the [http://www.getty.edu/research/conducting_research/vocabularies/tgn/index.html Getty Thesaurus of Geographic Names Online], subject to licensing and charset choice); and promulgating authority lists may best be done publicly by search engine managements, who may disagree with each other.&amp;lt;br /&amp;gt;Allowing Unicode for non-Roman alphabet-using locales is desirable, but at present that may raise technical problems, including computer security issues, that are not yet readily soluble.&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| keywords-not&lt;br /&gt;
| A comma-separated list of negative keywords that distinguish a closely-related theme from this page&#039;s true theme, to support Boolean NOT searches often more realistically than visible text can, especially when both themes share the same lexicon.&amp;lt;br /&amp;gt;If keywords is no longer a supported name for a meta element, keywords-not is superfluous; however, debate has been revived on whether keywords should be supported or not; see the keywords entry in this Wiki.&lt;br /&gt;
| [http://www.w3.org/Bugs/Public/show_bug.cgi?id=6609 W3C Bug 6609]&lt;br /&gt;
|&lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| nextgen&lt;br /&gt;
| Used for nextgen gallery plugin in wordpress&lt;br /&gt;
| [http://www.alexa.com/faqs/?p=188 Alexa FAQ About this meta attribute Reference]&lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Unrelated spec link&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| page-datetime&lt;br /&gt;
| Better ranking in search engine results for recency or relevance to an event date would be aided by a standard format robots can parse. Users would save search time by not having to load many pages to find which ones are new or date-relevant.&amp;lt;br /&amp;gt;To supply a consistent and known format, the value for this keyword is a date-time expression formed in accordance with http://www.w3.org/TR/NOTE-datetime (albeit a note that&#039;s at W3C only for discussion). Any of the six levels of granularity in that note are acceptable, such as expressing only a year.&amp;lt;br /&amp;gt;Should this keyword appear more than once, only the first one so appearing is determinative.&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| page-version&lt;br /&gt;
| Pages may be revised several times daily. While date-time given to a granularity of a fraction of a second would often suffice, when a page has to be approved more than once before posting, any or no such time may be correct (without this keyword, a comment could be necessary but probably not parsable by an engine). In addition, versions regardless of date may show consecutiveness and can replace a date that must be vague. In that case, a version number may be more useful for searches and so a robot-parsable format is needed.&amp;lt;br /&amp;gt;The keyword&#039;s value is stated in ASCII digits, is any nonnegative base-10 rational number expressed as an integer or a decimal, with any number of decimal places allowed, and may be padded with any number of leading zeros to support extraction for ASCII sorting.&amp;lt;br /&amp;gt;Should this keyword appear more than once, only the first one so appearing is determinative.&amp;lt;br /&amp;gt;The versions 0 and 0.&#039;&#039;n&#039;&#039;, with &#039;&#039;n&#039;&#039; being to any number of places, signify beta versions, i.e., drafts, in the tradition of beta software, while versions 1 and higher ordinarily signify final-release versions. After a final-release version is released, a draft of a later version is not given a version number of 0 or 0.&#039;&#039;n&#039;&#039;, but is numbered higher than the last final-release version. It is suggested to page authors that draft status, if applicable, be shown in the visibly displayed text of the page, rather than that this meta tag be relied upon as the sole notice of draft status, as it may be inadequate notice if alone.&amp;lt;br /&amp;gt;To assign a low page-version such as 0.&#039;&#039;n&#039;&#039; or 1, the page&#039;s URL, if static, may be used as the relevant premise. Thus, if a page is copied or moved to a new URL, the author may choose to restart page-version numbering from 0.&#039;&#039;n&#039;&#039; or 1. If a page&#039;s URL is dynamic, e.g., if created on the fly from a script, the page author may prefer to use as the relevant premise for assigning a low page-version such as 0.&#039;&#039;n&#039;&#039; or 1 the URL of the script or other technology that generates the dynamic-URL page, placing this meta element containing this attribute within the script or other technology, not within the generating page&#039;s head element (the generating page&#039;s head element may have its own meta element with this attribute describing the generating page). If one page containing the script or other technology that generates another page has more than one means for generating dynamic-URL pages, each means should contain its own meta element with this attribute. Page-version is thus largely independent of the page&#039;s date, although both would likely advance roughly in parallel.&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| resolutions&lt;br /&gt;
| Authoring web sites to use resolution independent images that display beautifully on high-resolution displays should be made as easy as possible for developers and should not require JavaScript to accomplish.&lt;br /&gt;
&lt;br /&gt;
To accomplish this, I propose a new HTML Meta Tag, &amp;lt;code&amp;gt;resolutions&amp;lt;/code&amp;gt;, that can be used to specify that high-resolution versions of images linked to from the page are available and that the browser should use them in place of the lower-resolution default images if it detects that a user is using a high-resolution screen. The resolutions meta tag lists the device-pixel ratios supported by images in the page. &lt;br /&gt;
&lt;br /&gt;
So, for example…&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;meta name=&amp;quot;resolutions&amp;quot; content=&amp;quot;2x&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
… means that the developer is telling the browser that she has created 2x resolution images for the images linked to from the current page and named them with a @2x suffix. &lt;br /&gt;
&lt;br /&gt;
To illustrate, if her image tag is as follows…&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;img src=&amp;quot;/images/flower.jpg&amp;quot; alt=&amp;quot;A flower&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
… then she has two image files under /images: the low-resolution default (flower.jpg), and a higher-resolution (200%) version named flower@2x.jpg. &lt;br /&gt;
&lt;br /&gt;
(This is the same naming convention already used by Apple in its Cocoa Touch framework for automatically loading in higher-resolution versions of images.)&lt;br /&gt;
&lt;br /&gt;
Based on the meta tag, if the browser detects that the user is running at a &amp;lt;code&amp;gt;min-device-pixel-ratio&amp;lt;/code&amp;gt; of 2.0, it will automatically ask for the 2x version of the image (flower@2x.jpg) instead of the default image as specified in the image tag. &lt;br /&gt;
&lt;br /&gt;
Finally, so as not to flood external sites with high-resolution image requests, this functionality would only work for local images specified via relative links.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Multiple resolutions&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resolutions tag can also contain a list of supported device-pixel ratios so as to support even higher-resolution displays when and if they become available in the future. &lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;meta name=&amp;quot;resolutions&amp;quot; content=&amp;quot;2x, 4x, 8x&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the developer would provide 2x, 4x, and 8x versions of all images. So, in the running example, she would make flower.jpg, flower@2x.jpg, flower@4x.jpg, and flower@8x.jpg.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Advantages&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The advantages of this approach are several:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;Makes it very simple for developers to support high-resolution displays like the iPhone 4&#039;s Retina screen&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;Does not require JavaScript&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;Does not change the default way that things work (if the meta tag is not specified, the browser simply behaves as it always has).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| [http://aralbalkan.com/3355 Proposal for native browser support of high-resolution image substitution]&lt;br /&gt;
[http://aralbalkan.com/3331 How to make your web content look stunning on the iPhone 4’s new Retina display]&lt;br /&gt;
|&lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| rights&lt;br /&gt;
| As a page effectively appears in at least two forms, usually one as interpreted and displayed on a device and the other as source code, arguably intellectual property rights that must be asserted must be asserted in ways understandable in both contexts. For example, &amp;amp;amp;copy; is a raw representation that may legally fail as part of copyright notice to someone seeing source code and not the display, important when someone wants to copy source code for use elsewhere and may rely on a defense of innocent infringement (at least in U.S.). While such assertions can be made in a comment element, it may be helpful to have a tag that search engines can parse and index verbatim.&amp;lt;br /&amp;gt;The value may include standard and nonstandard notices, invocations of licenses such as GFDL and ASCAP, and any other information. Content is defined as free-form, leaving the page author discretion for the entry.&amp;lt;br /&amp;gt;Statements in one tag may discuss several portions of the page differently, e.g., with different licenses.&amp;lt;br /&amp;gt;More than one license may be offered, along with the page&#039;s relationship to all.&amp;lt;br /&amp;gt;Not all statements need be license grants. A statement may state whom to ask for reprint permission or may reserve all rights, for example.&amp;lt;br /&amp;gt;Only one meta tag with this keyword may be present. Page authors must not use more than one. A UA finding multiple such tags on one page must ignore all of them.&amp;lt;br /&amp;gt;The copyright symbol that would be generated by its character entity is not recommended for legal notice in source code when the word &#039;Copyright&#039; may be used instead, because the entity may be read in raw form, but use is up to the page author. The same concept applies to any intellectual property rights symbol for which a suitable alternative is available, such as for trademark or service mark.&amp;lt;br /&amp;gt;ASCII text would not suffice when a name or notice legally may have to be in a non-Roman alphabet, but no alternative may yet exist in HTML5.&amp;lt;br /&amp;gt;Search engine storage may impose a length limit, but, because of legal consequences, if the value&#039;s length exceeds a given limit the search index should retain or interpret none of it but only refer to it.&amp;lt;br /&amp;gt;The content string may only be copied verbatim in its full length, referred to, or ignored. It may not be, for example, paraphrased, truncated, interpreted, or classified except in addition to being copied verbatim in its full length.&amp;lt;br /&amp;gt;Ignoring shall not void, nullify, or alter any rights stated in such tag.&amp;lt;br /&amp;gt;For the synonymy, &#039;&#039;IP&#039;&#039;, &#039;&#039;IP-rights&#039;&#039;, and &#039;&#039;IP-right&#039;&#039; are not reserved; while the abbreviation &#039;&#039;IP&#039;&#039; &#039;intellectual property&#039; is common among attorneys in the U.S., page authors will more likely be computerate, and the abbreviation may be wanted for &#039;Internet Protocol&#039;.&lt;br /&gt;
| [[Talk:MetaExtensions#rights:_why_reversion|Talk]]&lt;br /&gt;
|&lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| subj-. . .&lt;br /&gt;
| To classify by subject a page&#039;s content, a standard subject taxonomy that will be recognized by a search engine or directory will help. Because many such high-quality taxonomies exist, only a prefix is proposed. Over time, particular taxonomies, in print or online, may be recognized here and keywords assigned for each.&amp;lt;br /&amp;gt;The keyword will be constructed case-insensitively with subkeywords in the form subj-[nationAbbrev]-[taxonomy]-[edition][-optionalSubedition], e.g., subj-US-MeSH-2009online (perhaps). After &amp;quot;subj-&amp;quot;, the second subkeyword will identify the nation where the taxonomy is published or offered as an aid in identifying the taxonomy and does not limit the subject coverage; e.g., a taxonomy published in Japan may be ideal for classifying Canadian botany or Peruvian economy.&amp;lt;br /&amp;gt;As subject values may vary between editions of one taxonomy, an edition and optionally a subedition is to be identified in the third and optionally the fourth subkeywords. The subedition, if any, is any update or revision occurring between editions, such that a value drawn from that edition and subedition is stable. The means of identifying edition and subedition should be included in the registration of a keyword.&amp;lt;br /&amp;gt;Examples of taxonomies from the U.S. include MeSH (medical) and the Library of Congress Subject Headings.&amp;lt;br /&amp;gt;The value identifying a subject for a Web page will be drawn from the cited taxonomy&#039;s edition and subedition.&amp;lt;br /&amp;gt;If the value should have a style to prevent ambiguity in interpretation, that style is to be registered here for that keyword. Multiple values are expressed with multiple meta elements, one value for each, since comma-separation is probably not compatible with all taxonomies.&amp;lt;br /&amp;gt;If a value requires case-sensitivity to prevent confusion, the entry here registering the keyword must accommodate that need with the needs of HTML 5 with an appropriate rule. To that end, a proposal to allow case-sensitivity in meta tags under some circumstances has been offered in the W3C bug reporting system.&lt;br /&gt;
| [http://www.w3.org/Bugs/Public/show_bug.cgi?id=6854 W3C Bug 6854]&lt;br /&gt;
| subject-. . .&lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks link to a spec, tries to register a space of names instead of enumerated names&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| nibbler-site-verification&lt;br /&gt;
| Used to verify ownership of Nibbler site&lt;br /&gt;
| [http://nibbler.silktide.com/ Nibbler site]&lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Claimed spec link does not link to a spec&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| MSSmartTagsPreventParsing&lt;br /&gt;
| Microsoft introduced into Internet Explorer 6 Beta a feature that some website designers wished to preclude from applying in order to prevent public misunderstanding of their websites. The feature allowed a browser to add information but at a risk that users wouldn&#039;t know that it wasn&#039;t supplied by the website. This keyword was provided by Microsoft for those of us who wanted it.&amp;lt;br /&amp;gt;Its value was &amp;quot;TRUE&amp;quot;. Microsoft spelled the keyword with some capitals and the value in all capitals but whether capitalization was required for either is unknown; some opinions vary. Since it need be understood by only one browser, and that one a beta version, full standards compliance should not be assumed, and original case may be required. (This tag is used by Google: &amp;quot;&amp;lt;meta content=&#039;true&#039; name=&#039;MSSmartTagsPreventParsing&#039;/&amp;gt;&amp;quot; appeared (with internal quote marks as singles) in the source code for &amp;lt;http://googleblog.blogspot.com/2009/04/listening-to-google-health-users.html&amp;gt;, as accessed 4-27-09.)&amp;lt;br /&amp;gt;Microsoft has apparently removed this instruction from its website on the ground that the beta version is no longer available and is not supported, but that doesn&#039;t assure that some users aren&#039;t still using the beta browser, perhaps inadvertently. Therefore, designers may wish to continue using the keyword and value and they are preserved here.&lt;br /&gt;
| e.g., [http://www.theregister.co.uk/2001/06/25/web_sites_banish_those_winxp/ The Register (U.K.)], [http://cc.uoregon.edu/cnews/summer2001/summer2001.pdf Univ. Oregon (U.S.) (PDF p. 18)], &amp;amp; [http://trillian.mit.edu/~jc/demo/SmartTagsOff.html John Chambers (U.S.) (job résumé near root)], all as accessed 4-19-09&lt;br /&gt;
| &lt;br /&gt;
| Incomplete proposal&lt;br /&gt;
| Lacks spec, potentially never minted by MS as a meta name (as opposed to a http-equiv value), even if minted by Microsoft, abandoned before shipping in any final release of IE&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Failed Proposals ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Keyword&lt;br /&gt;
! Brief description&lt;br /&gt;
! Link to more details&lt;br /&gt;
! Synonyms&lt;br /&gt;
! Status&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| cache&lt;br /&gt;
| This doesn&#039;t actually work; use HTTP headers instead.&amp;lt;br /&amp;gt;Value must be &amp;quot;public&amp;quot;, &amp;quot;private&amp;quot;, or &amp;quot;no-cache&amp;quot;. Intended as a simple way to tell user agents whether to store a copy of the document or not. An alternate for HTTP/1.1&#039;s cache-control; for publishers without access to modifying cache-control.&lt;br /&gt;
| none&lt;br /&gt;
| &lt;br /&gt;
| Unendorsed&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; &lt;br /&gt;
| no-email-collection&lt;br /&gt;
| HTML5 prohibits URL-valued meta names. They should be rel keywords instead.&amp;lt;br /&amp;gt;Intended to reference legal policy of web site indicating that harvesting of e-mail addresses on the site is not permitted and in violation of applicable laws such as the CAN-SPAM Act of 2003.&lt;br /&gt;
| [https://www.ProjectHoneyPot.org/how_to_avoid_spambots_5.php Project Honey Pot]&lt;br /&gt;
| &lt;br /&gt;
| Unendorsed&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Process ==&lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;Status&amp;quot; section to be changed to &amp;quot;Ratified&amp;quot;, the proposed keyword must be defined by a W3C specification in the Candidate Recommendation or Recommendation state. If it fails to go through this process, it is &amp;quot;Unendorsed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For more details, see [http://whatwg.org/specs/web-apps/current-work/#concept-meta-extensions the HTML5 specification].&lt;br /&gt;
&lt;br /&gt;
[[Category:Registries]]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7074</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7074"/>
		<updated>2011-08-21T12:41:12Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type (which may or may not be determined by file extension) that determines what type of document you are using.  Any document served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, including a document authored with the intention of being XHTML, is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data. An exception is made for foreign content such as SVG or MathML.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below or for SVG/MathML).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference can be upper-case.&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference cannot be upper-case.&lt;br /&gt;
|&lt;br /&gt;
| Only use the lower-case &#039;x&#039; for hexadecimal character references.&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| Unicode characters except for U+0000, non-characters, and control characters (besides space) characters.&lt;br /&gt;
| XML 1.0 only allows the following Unicode &amp;lt;code&amp;gt;#x9, #xA, #xD, [#x20-#xD7FF], [#xE000-#xFFFD], [#x10000-#x10FFFF]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XML 1.1 allows all Unicode (including all in 1.0) except for U+0000, U+FFFE, and U+FFFF (i.e., it allows &amp;lt;code&amp;gt;[#x1-#xFFFD], [#x10000-#x10FFFF]&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Both XML 1.0 and 1.1 discourage control-characters and non-characters:&lt;br /&gt;
&lt;br /&gt;
Discouraged in XML 1.0 only: &amp;lt;code&amp;gt;[#xFDE0-#xFDEF]&amp;lt;/code&amp;gt; (spec typo?)&lt;br /&gt;
&lt;br /&gt;
Discouraged in XML 1.1 only (these are not allowed at all in 1.0): &amp;lt;code&amp;gt;[#x1-#x8], [#xB-#xC], [#xE-#x1F]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Discouraged in XML 1.0-1.1: &amp;lt;code&amp;gt;[#x7F-#x84], [#x86-#x9F], [#xFDD0-#xFDDF], [#x1FFFE-#x1FFFF], [#x2FFFE-#x2FFFF], [#x3FFFE-#x3FFFF], [#x4FFFE-#x4FFFF], [#x5FFFE-#x5FFFF], [#x6FFFE-#x6FFFF], [#x7FFFE-#x7FFFF], [#x8FFFE-#x8FFFF], [#x9FFFE-#x9FFFF], [#xAFFFE-#xAFFFF], [#xBFFFE-#xBFFFF], [#xCFFFE-#xCFFFF], [#xDFFFE-#xDFFFF], [#xEFFFE-#xEFFFF], [#xFFFFE-#xFFFFF], [#x10FFFE-#x10FFFF]&amp;lt;/code&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;lt;code&amp;gt;#x9, #xA, #xD, [#x20-#xD7FF], [#xE000-#xFFFD], [#x10000-#x10FFFF]&amp;lt;/code&amp;gt; while avoiding &amp;lt;code&amp;gt;[#xFDE0-#xFDEF] (?), [#x7F-#x84], [#x86-#x9F], [#xFDD0-#xFDDF], [#x1FFFE-#x1FFFF], [#x2FFFE-#x2FFFF], [#x3FFFE-#x3FFFF], [#x4FFFE-#x4FFFF], [#x5FFFE-#x5FFFF], [#x6FFFE-#x6FFFF], [#x7FFFE-#x7FFFF], [#x8FFFE-#x8FFFF], [#x9FFFE-#x9FFFF], [#xAFFFE-#xAFFFF], [#xBFFFE-#xBFFFF], [#xCFFFE-#xCFFFF], [#xDFFFE-#xDFFFF], [#xEFFFE-#xEFFFF], [#xFFFFE-#xFFFFF], [#x10FFFE-#x10FFFF]&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Element(s)&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). &lt;br /&gt;
| In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML). &lt;br /&gt;
| There is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, if scripting is enabled, this element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element.&lt;br /&gt;
| In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &lt;br /&gt;
| &lt;br /&gt;
| Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements.&lt;br /&gt;
| In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not add content within these elements (or hide them on page load/DOMContentLoaded by JavaScript).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; when appearing out of context&lt;br /&gt;
| In HTML, the tags for these elements, when appearing out of context, are ignored. (How so?)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use these elements out of context. In the case of &amp;amp;lt;tr&amp;gt; directly inside a &amp;amp;lt;table&amp;gt;, one may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt;&lt;br /&gt;
| This element has a special parsing requirement in HTML. (It is, however, forbidden.) &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, a line feed that immediately follows any of these element&#039;s start tag is ignored. &lt;br /&gt;
| In XML, it is treated as other content.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Add any line break before the element begins using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| These elements are void elements in HTML. &lt;br /&gt;
| In XHTML, these may use explicit closing tags as well as self-closing ones (just as non-void elements can).&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use an explicit closing tag for these void elements to avoid double-inclusion when shown in HTML (and avoid self-closing tags on non-void elements which can sometimes accept content (such as &amp;amp;lt;script&amp;gt;)).&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; &lt;br /&gt;
| Available in HTML.&lt;br /&gt;
| These cannot be used in XHTML.&lt;br /&gt;
|&lt;br /&gt;
| Use DOM methods to replace or add content dynamically.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property&lt;br /&gt;
| Any HTML can be used.&lt;br /&gt;
| The use of this property requires that the string be a well-formed fragment of XML.&lt;br /&gt;
| &lt;br /&gt;
| Ensure one sets &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; to well-formed fragments. &lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! DOM APIs and case sensitivity&lt;br /&gt;
| Some DOM APIs are case insensitive in HTML (which are sensitive?). (This does not apply to elements which are not in the HTML namespace.)&lt;br /&gt;
| DOM APIs are case sensitive in XHTML&lt;br /&gt;
|&lt;br /&gt;
| Use lower-case elements, attributes, and attribute values (or as appropriate with SVG camel-cased elements and attributes (and the &amp;quot;definitionURL&amp;quot; attribute should use proper casing when used in MathML)).&lt;br /&gt;
|-&lt;br /&gt;
! Element.tagName and Node.nodeName properties&lt;br /&gt;
| These properties return the value in uppercase in HTML. (Node.localName is consistent now, as of HTML5.)&lt;br /&gt;
| These properties return the value in lower-case in XHTML.&lt;br /&gt;
|&lt;br /&gt;
| For older browsers, compare after converting to lower case.&lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() &lt;br /&gt;
| Case insensitive&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Element.setAttributeNode() &lt;br /&gt;
| Changes the attribute name to lowercase. &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Do not expect to use upper-case attribute names.&lt;br /&gt;
|-&lt;br /&gt;
! Element.setAttribute()&lt;br /&gt;
| Case insensitive &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Document.getElementsByTagName() and Element.getElementsByTagName() &lt;br /&gt;
| Case insensitive in HTML&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Document.renameNode()&lt;br /&gt;
| If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Do not expect to keep upper-case attribute names for HTML-namespaced elements after a rename.&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() and namespaces&lt;br /&gt;
| In HTML, this will create an element in the HTML namespace.&lt;br /&gt;
| In XML (including true XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
| In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
| &#039;&#039;&#039;If operating within a browser which supports it, use Document.createElementNS to avoid the ambiguity.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! XPath expressions&lt;br /&gt;
| In pre-HTML5 browsers, the XHTML namespace must be used for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
| In XHTML, all XPath will require a namespace unless the elements genuinely have no namespace.&lt;br /&gt;
| &lt;br /&gt;
| Detect whether the browser is pre-HTML5 and omit namespaces in XPath expressions if so (otherwise, use a namespace).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! CSS Selectors&lt;br /&gt;
| Match case insensitively in HTML. &lt;br /&gt;
| Match case sensitively in XHTML&lt;br /&gt;
| &lt;br /&gt;
| For polyglot documents, use lower-case selectors or as appropriate (e.g., for SVG CamelCased items).&lt;br /&gt;
|-&lt;br /&gt;
! Styling of html/body elements&lt;br /&gt;
| CSS requires special handling of the body element in HTML for painting backgrounds on the canvas&lt;br /&gt;
| XHTML does not require special handling.&lt;br /&gt;
| &lt;br /&gt;
| Style the html and body elements appropriately (?).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7073</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7073"/>
		<updated>2011-08-21T12:40:11Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type (which may or may not be determined by file extension) that determines what type of document you are using.  Any document served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, including a document authored with the intention of being XHTML, is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data. An exception is made for foreign content such as SVG or MathML.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below or for SVG/MathML).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference can be upper-case.&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference cannot be upper-case.&lt;br /&gt;
|&lt;br /&gt;
| Only use the lower-case &#039;x&#039; for hexadecimal character references.&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| Unicode characters except for U+0000, non-characters, and control characters (besides space) characters.&lt;br /&gt;
| XML 1.0 only allows the following Unicode &amp;lt;code&amp;gt;#x9, #xA, #xD, [#x20-#xD7FF], [#xE000-#xFFFD], [#x10000-#x10FFFF]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XML 1.1 allows all Unicode (including all in 1.0) except for U+0000, U+FFFE, and U+FFFF (i.e., it allows &amp;lt;code&amp;gt;[#x1-#xFFFD] | [#x10000-#x10FFFF]&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Both XML 1.0 and 1.1 discourage control-characters and non-characters:&lt;br /&gt;
&lt;br /&gt;
Discouraged in XML 1.0 only: &amp;lt;code&amp;gt;[#xFDE0-#xFDEF]&amp;lt;/code&amp;gt; (spec typo?)&lt;br /&gt;
&lt;br /&gt;
Discouraged in XML 1.1 only (these are not allowed at all in 1.0): &amp;lt;code&amp;gt;[#x1-#x8], [#xB-#xC], [#xE-#x1F]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Discouraged in XML 1.0-1.1: &amp;lt;code&amp;gt;[#x7F-#x84], [#x86-#x9F], [#xFDD0-#xFDDF], [#x1FFFE-#x1FFFF], [#x2FFFE-#x2FFFF], [#x3FFFE-#x3FFFF], [#x4FFFE-#x4FFFF], [#x5FFFE-#x5FFFF], [#x6FFFE-#x6FFFF], [#x7FFFE-#x7FFFF], [#x8FFFE-#x8FFFF], [#x9FFFE-#x9FFFF], [#xAFFFE-#xAFFFF], [#xBFFFE-#xBFFFF], [#xCFFFE-#xCFFFF], [#xDFFFE-#xDFFFF], [#xEFFFE-#xEFFFF], [#xFFFFE-#xFFFFF], [#x10FFFE-#x10FFFF]&amp;lt;/code&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;lt;code&amp;gt;#x9, #xA, #xD, [#x20-#xD7FF], [#xE000-#xFFFD], [#x10000-#x10FFFF]&amp;lt;/code&amp;gt; while avoiding &amp;lt;code&amp;gt;[#xFDE0-#xFDEF] (?), [#x7F-#x84], [#x86-#x9F], [#xFDD0-#xFDDF], [#x1FFFE-#x1FFFF], [#x2FFFE-#x2FFFF], [#x3FFFE-#x3FFFF], [#x4FFFE-#x4FFFF], [#x5FFFE-#x5FFFF], [#x6FFFE-#x6FFFF], [#x7FFFE-#x7FFFF], [#x8FFFE-#x8FFFF], [#x9FFFE-#x9FFFF], [#xAFFFE-#xAFFFF], [#xBFFFE-#xBFFFF], [#xCFFFE-#xCFFFF], [#xDFFFE-#xDFFFF], [#xEFFFE-#xEFFFF], [#xFFFFE-#xFFFFF], [#x10FFFE-#x10FFFF]&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Element(s)&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). &lt;br /&gt;
| In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML). &lt;br /&gt;
| There is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, if scripting is enabled, this element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element.&lt;br /&gt;
| In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &lt;br /&gt;
| &lt;br /&gt;
| Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements.&lt;br /&gt;
| In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not add content within these elements (or hide them on page load/DOMContentLoaded by JavaScript).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; when appearing out of context&lt;br /&gt;
| In HTML, the tags for these elements, when appearing out of context, are ignored. (How so?)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use these elements out of context. In the case of &amp;amp;lt;tr&amp;gt; directly inside a &amp;amp;lt;table&amp;gt;, one may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt;&lt;br /&gt;
| This element has a special parsing requirement in HTML. (It is, however, forbidden.) &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, a line feed that immediately follows any of these element&#039;s start tag is ignored. &lt;br /&gt;
| In XML, it is treated as other content.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Add any line break before the element begins using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| These elements are void elements in HTML. &lt;br /&gt;
| In XHTML, these may use explicit closing tags as well as self-closing ones (just as non-void elements can).&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use an explicit closing tag for these void elements to avoid double-inclusion when shown in HTML (and avoid self-closing tags on non-void elements which can sometimes accept content (such as &amp;amp;lt;script&amp;gt;)).&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; &lt;br /&gt;
| Available in HTML.&lt;br /&gt;
| These cannot be used in XHTML.&lt;br /&gt;
|&lt;br /&gt;
| Use DOM methods to replace or add content dynamically.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property&lt;br /&gt;
| Any HTML can be used.&lt;br /&gt;
| The use of this property requires that the string be a well-formed fragment of XML.&lt;br /&gt;
| &lt;br /&gt;
| Ensure one sets &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; to well-formed fragments. &lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! DOM APIs and case sensitivity&lt;br /&gt;
| Some DOM APIs are case insensitive in HTML (which are sensitive?). (This does not apply to elements which are not in the HTML namespace.)&lt;br /&gt;
| DOM APIs are case sensitive in XHTML&lt;br /&gt;
|&lt;br /&gt;
| Use lower-case elements, attributes, and attribute values (or as appropriate with SVG camel-cased elements and attributes (and the &amp;quot;definitionURL&amp;quot; attribute should use proper casing when used in MathML)).&lt;br /&gt;
|-&lt;br /&gt;
! Element.tagName and Node.nodeName properties&lt;br /&gt;
| These properties return the value in uppercase in HTML. (Node.localName is consistent now, as of HTML5.)&lt;br /&gt;
| These properties return the value in lower-case in XHTML.&lt;br /&gt;
|&lt;br /&gt;
| For older browsers, compare after converting to lower case.&lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() &lt;br /&gt;
| Case insensitive&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Element.setAttributeNode() &lt;br /&gt;
| Changes the attribute name to lowercase. &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Do not expect to use upper-case attribute names.&lt;br /&gt;
|-&lt;br /&gt;
! Element.setAttribute()&lt;br /&gt;
| Case insensitive &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Document.getElementsByTagName() and Element.getElementsByTagName() &lt;br /&gt;
| Case insensitive in HTML&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Document.renameNode()&lt;br /&gt;
| If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Do not expect to keep upper-case attribute names for HTML-namespaced elements after a rename.&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() and namespaces&lt;br /&gt;
| In HTML, this will create an element in the HTML namespace.&lt;br /&gt;
| In XML (including true XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
| In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
| &#039;&#039;&#039;If operating within a browser which supports it, use Document.createElementNS to avoid the ambiguity.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! XPath expressions&lt;br /&gt;
| In pre-HTML5 browsers, the XHTML namespace must be used for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
| In XHTML, all XPath will require a namespace unless the elements genuinely have no namespace.&lt;br /&gt;
| &lt;br /&gt;
| Detect whether the browser is pre-HTML5 and omit namespaces in XPath expressions if so (otherwise, use a namespace).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! CSS Selectors&lt;br /&gt;
| Match case insensitively in HTML. &lt;br /&gt;
| Match case sensitively in XHTML&lt;br /&gt;
| &lt;br /&gt;
| For polyglot documents, use lower-case selectors or as appropriate (e.g., for SVG CamelCased items).&lt;br /&gt;
|-&lt;br /&gt;
! Styling of html/body elements&lt;br /&gt;
| CSS requires special handling of the body element in HTML for painting backgrounds on the canvas&lt;br /&gt;
| XHTML does not require special handling.&lt;br /&gt;
| &lt;br /&gt;
| Style the html and body elements appropriately (?).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7072</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7072"/>
		<updated>2011-08-21T12:39:14Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type (which may or may not be determined by file extension) that determines what type of document you are using.  Any document served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, including a document authored with the intention of being XHTML, is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data. An exception is made for foreign content such as SVG or MathML.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below or for SVG/MathML).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference can be upper-case.&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference cannot be upper-case.&lt;br /&gt;
|&lt;br /&gt;
| Only use the lower-case &#039;x&#039; for hexadecimal character references.&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| Unicode characters except for U+0000, non-characters, and control characters (besides space) characters.&lt;br /&gt;
| XML 1.0 only allows the following Unicode &amp;lt;code&amp;gt;#x9, #xA, #xD, [#x20-#xD7FF], [#xE000-#xFFFD], [#x10000-#x10FFFF]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XML 1.1 allows all Unicode (including all in 1.0) except for U+0000, U+FFFE, and U+FFFF (i.e., it allows &amp;lt;code&amp;gt;[#x1-#xFFFD] | [#x10000-#x10FFFF]&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Both XML 1.0 and 1.1 discourage control-characters and non-characters:&lt;br /&gt;
Discouraged in XML 1.0 only: &amp;lt;code&amp;gt;[#xFDE0-#xFDEF]&amp;lt;/code&amp;gt; (spec typo?)&lt;br /&gt;
Discouraged in XML 1.1 only (these are not allowed at all in 1.0): &amp;lt;code&amp;gt;[#x1-#x8], [#xB-#xC], [#xE-#x1F]&amp;lt;/code&amp;gt;&lt;br /&gt;
Discouraged in XML 1.0-1.1: &amp;lt;code&amp;gt;[#x7F-#x84], [#x86-#x9F], [#xFDD0-#xFDDF], [#x1FFFE-#x1FFFF], [#x2FFFE-#x2FFFF], [#x3FFFE-#x3FFFF], [#x4FFFE-#x4FFFF], [#x5FFFE-#x5FFFF], [#x6FFFE-#x6FFFF], [#x7FFFE-#x7FFFF], [#x8FFFE-#x8FFFF], [#x9FFFE-#x9FFFF], [#xAFFFE-#xAFFFF], [#xBFFFE-#xBFFFF], [#xCFFFE-#xCFFFF], [#xDFFFE-#xDFFFF], [#xEFFFE-#xEFFFF], [#xFFFFE-#xFFFFF], [#x10FFFE-#x10FFFF]&amp;lt;/code&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;lt;code&amp;gt;#x9, #xA, #xD, [#x20-#xD7FF], [#xE000-#xFFFD], [#x10000-#x10FFFF]&amp;lt;/code&amp;gt; while avoiding &amp;lt;code&amp;gt;[#xFDE0-#xFDEF] (?), [#x7F-#x84], [#x86-#x9F], [#xFDD0-#xFDDF], [#x1FFFE-#x1FFFF], [#x2FFFE-#x2FFFF], [#x3FFFE-#x3FFFF], [#x4FFFE-#x4FFFF], [#x5FFFE-#x5FFFF], [#x6FFFE-#x6FFFF], [#x7FFFE-#x7FFFF], [#x8FFFE-#x8FFFF], [#x9FFFE-#x9FFFF], [#xAFFFE-#xAFFFF], [#xBFFFE-#xBFFFF], [#xCFFFE-#xCFFFF], [#xDFFFE-#xDFFFF], [#xEFFFE-#xEFFFF], [#xFFFFE-#xFFFFF], [#x10FFFE-#x10FFFF]&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Element(s)&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). &lt;br /&gt;
| In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML). &lt;br /&gt;
| There is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, if scripting is enabled, this element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element.&lt;br /&gt;
| In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &lt;br /&gt;
| &lt;br /&gt;
| Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements.&lt;br /&gt;
| In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not add content within these elements (or hide them on page load/DOMContentLoaded by JavaScript).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; when appearing out of context&lt;br /&gt;
| In HTML, the tags for these elements, when appearing out of context, are ignored. (How so?)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use these elements out of context. In the case of &amp;amp;lt;tr&amp;gt; directly inside a &amp;amp;lt;table&amp;gt;, one may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt;&lt;br /&gt;
| This element has a special parsing requirement in HTML. (It is, however, forbidden.) &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, a line feed that immediately follows any of these element&#039;s start tag is ignored. &lt;br /&gt;
| In XML, it is treated as other content.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Add any line break before the element begins using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| These elements are void elements in HTML. &lt;br /&gt;
| In XHTML, these may use explicit closing tags as well as self-closing ones (just as non-void elements can).&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use an explicit closing tag for these void elements to avoid double-inclusion when shown in HTML (and avoid self-closing tags on non-void elements which can sometimes accept content (such as &amp;amp;lt;script&amp;gt;)).&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; &lt;br /&gt;
| Available in HTML.&lt;br /&gt;
| These cannot be used in XHTML.&lt;br /&gt;
|&lt;br /&gt;
| Use DOM methods to replace or add content dynamically.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property&lt;br /&gt;
| Any HTML can be used.&lt;br /&gt;
| The use of this property requires that the string be a well-formed fragment of XML.&lt;br /&gt;
| &lt;br /&gt;
| Ensure one sets &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; to well-formed fragments. &lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! DOM APIs and case sensitivity&lt;br /&gt;
| Some DOM APIs are case insensitive in HTML (which are sensitive?). (This does not apply to elements which are not in the HTML namespace.)&lt;br /&gt;
| DOM APIs are case sensitive in XHTML&lt;br /&gt;
|&lt;br /&gt;
| Use lower-case elements, attributes, and attribute values (or as appropriate with SVG camel-cased elements and attributes (and the &amp;quot;definitionURL&amp;quot; attribute should use proper casing when used in MathML)).&lt;br /&gt;
|-&lt;br /&gt;
! Element.tagName and Node.nodeName properties&lt;br /&gt;
| These properties return the value in uppercase in HTML. (Node.localName is consistent now, as of HTML5.)&lt;br /&gt;
| These properties return the value in lower-case in XHTML.&lt;br /&gt;
|&lt;br /&gt;
| For older browsers, compare after converting to lower case.&lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() &lt;br /&gt;
| Case insensitive&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Element.setAttributeNode() &lt;br /&gt;
| Changes the attribute name to lowercase. &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Do not expect to use upper-case attribute names.&lt;br /&gt;
|-&lt;br /&gt;
! Element.setAttribute()&lt;br /&gt;
| Case insensitive &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Document.getElementsByTagName() and Element.getElementsByTagName() &lt;br /&gt;
| Case insensitive in HTML&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Document.renameNode()&lt;br /&gt;
| If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Do not expect to keep upper-case attribute names for HTML-namespaced elements after a rename.&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() and namespaces&lt;br /&gt;
| In HTML, this will create an element in the HTML namespace.&lt;br /&gt;
| In XML (including true XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
| In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
| &#039;&#039;&#039;If operating within a browser which supports it, use Document.createElementNS to avoid the ambiguity.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! XPath expressions&lt;br /&gt;
| In pre-HTML5 browsers, the XHTML namespace must be used for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
| In XHTML, all XPath will require a namespace unless the elements genuinely have no namespace.&lt;br /&gt;
| &lt;br /&gt;
| Detect whether the browser is pre-HTML5 and omit namespaces in XPath expressions if so (otherwise, use a namespace).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! CSS Selectors&lt;br /&gt;
| Match case insensitively in HTML. &lt;br /&gt;
| Match case sensitively in XHTML&lt;br /&gt;
| &lt;br /&gt;
| For polyglot documents, use lower-case selectors or as appropriate (e.g., for SVG CamelCased items).&lt;br /&gt;
|-&lt;br /&gt;
! Styling of html/body elements&lt;br /&gt;
| CSS requires special handling of the body element in HTML for painting backgrounds on the canvas&lt;br /&gt;
| XHTML does not require special handling.&lt;br /&gt;
| &lt;br /&gt;
| Style the html and body elements appropriately (?).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7071</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7071"/>
		<updated>2011-08-21T12:34:59Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type (which may or may not be determined by file extension) that determines what type of document you are using.  Any document served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, including a document authored with the intention of being XHTML, is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data. An exception is made for foreign content such as SVG or MathML.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below or for SVG/MathML).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference can be upper-case.&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference cannot be upper-case.&lt;br /&gt;
|&lt;br /&gt;
| Only use the lower-case &#039;x&#039; for hexadecimal character references.&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| Unicode characters except for U+0000, non-characters, and control characters (besides space) characters.&lt;br /&gt;
| XML 1.0 only allows the following Unicode #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]&lt;br /&gt;
&lt;br /&gt;
XML 1.1 allows all Unicode (including all in 1.0) except for U+0000, U+FFFE, and U+FFFF (i.e., it allows [#x1-#xFFFD] | [#x10000-#x10FFFF])&lt;br /&gt;
&lt;br /&gt;
Both XML 1.0 and 1.1 discourage control-characters and non-characters:&lt;br /&gt;
Discouraged in XML 1.0 only: [#xFDE0-#xFDEF] (spec typo?)&lt;br /&gt;
Discouraged in XML 1.1 only (these are not allowed at all in 1.0): [#x1-#x8], [#xB-#xC], [#xE-#x1F]&lt;br /&gt;
Discouraged in XML 1.0-1.1: [#x7F-#x84], [#x86-#x9F], [#xFDD0-#xFDDF], [#x1FFFE-#x1FFFF], [#x2FFFE-#x2FFFF], [#x3FFFE-#x3FFFF], [#x4FFFE-#x4FFFF], [#x5FFFE-#x5FFFF], [#x6FFFE-#x6FFFF], [#x7FFFE-#x7FFFF], [#x8FFFE-#x8FFFF], [#x9FFFE-#x9FFFF], [#xAFFFE-#xAFFFF], [#xBFFFE-#xBFFFF], [#xCFFFE-#xCFFFF], [#xDFFFE-#xDFFFF], [#xEFFFE-#xEFFFF], [#xFFFFE-#xFFFFF], [#x10FFFE-#x10FFFF])&lt;br /&gt;
| &lt;br /&gt;
| Use #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] while avoiding [#xFDE0-#xFDEF] (?) and [#x7F-#x84], [#x86-#x9F], [#xFDD0-#xFDDF], [#x1FFFE-#x1FFFF], [#x2FFFE-#x2FFFF], [#x3FFFE-#x3FFFF], [#x4FFFE-#x4FFFF], [#x5FFFE-#x5FFFF], [#x6FFFE-#x6FFFF], [#x7FFFE-#x7FFFF], [#x8FFFE-#x8FFFF], [#x9FFFE-#x9FFFF], [#xAFFFE-#xAFFFF], [#xBFFFE-#xBFFFF], [#xCFFFE-#xCFFFF], [#xDFFFE-#xDFFFF], [#xEFFFE-#xEFFFF], [#xFFFFE-#xFFFFF], [#x10FFFE-#x10FFFF])&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Element(s)&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). &lt;br /&gt;
| In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML). &lt;br /&gt;
| There is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, if scripting is enabled, this element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element.&lt;br /&gt;
| In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &lt;br /&gt;
| &lt;br /&gt;
| Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements.&lt;br /&gt;
| In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not add content within these elements (or hide them on page load/DOMContentLoaded by JavaScript).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; when appearing out of context&lt;br /&gt;
| In HTML, the tags for these elements, when appearing out of context, are ignored. (How so?)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use these elements out of context. In the case of &amp;amp;lt;tr&amp;gt; directly inside a &amp;amp;lt;table&amp;gt;, one may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt;&lt;br /&gt;
| This element has a special parsing requirement in HTML. (It is, however, forbidden.) &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, a line feed that immediately follows any of these element&#039;s start tag is ignored. &lt;br /&gt;
| In XML, it is treated as other content.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Add any line break before the element begins using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| These elements are void elements in HTML. &lt;br /&gt;
| In XHTML, these may use explicit closing tags as well as self-closing ones (just as non-void elements can).&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use an explicit closing tag for these void elements to avoid double-inclusion when shown in HTML (and avoid self-closing tags on non-void elements which can sometimes accept content (such as &amp;amp;lt;script&amp;gt;)).&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; &lt;br /&gt;
| Available in HTML.&lt;br /&gt;
| These cannot be used in XHTML.&lt;br /&gt;
|&lt;br /&gt;
| Use DOM methods to replace or add content dynamically.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property&lt;br /&gt;
| Any HTML can be used.&lt;br /&gt;
| The use of this property requires that the string be a well-formed fragment of XML.&lt;br /&gt;
| &lt;br /&gt;
| Ensure one sets &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; to well-formed fragments. &lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! DOM APIs and case sensitivity&lt;br /&gt;
| Some DOM APIs are case insensitive in HTML (which are sensitive?). (This does not apply to elements which are not in the HTML namespace.)&lt;br /&gt;
| DOM APIs are case sensitive in XHTML&lt;br /&gt;
|&lt;br /&gt;
| Use lower-case elements, attributes, and attribute values (or as appropriate with SVG camel-cased elements and attributes (and the &amp;quot;definitionURL&amp;quot; attribute should use proper casing when used in MathML)).&lt;br /&gt;
|-&lt;br /&gt;
! Element.tagName and Node.nodeName properties&lt;br /&gt;
| These properties return the value in uppercase in HTML. (Node.localName is consistent now, as of HTML5.)&lt;br /&gt;
| These properties return the value in lower-case in XHTML.&lt;br /&gt;
|&lt;br /&gt;
| For older browsers, compare after converting to lower case.&lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() &lt;br /&gt;
| Case insensitive&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Element.setAttributeNode() &lt;br /&gt;
| Changes the attribute name to lowercase. &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Do not expect to use upper-case attribute names.&lt;br /&gt;
|-&lt;br /&gt;
! Element.setAttribute()&lt;br /&gt;
| Case insensitive &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Document.getElementsByTagName() and Element.getElementsByTagName() &lt;br /&gt;
| Case insensitive in HTML&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Document.renameNode()&lt;br /&gt;
| If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Do not expect to keep upper-case attribute names for HTML-namespaced elements after a rename.&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() and namespaces&lt;br /&gt;
| In HTML, this will create an element in the HTML namespace.&lt;br /&gt;
| In XML (including true XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
| In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
| &#039;&#039;&#039;If operating within a browser which supports it, use Document.createElementNS to avoid the ambiguity.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! XPath expressions&lt;br /&gt;
| In pre-HTML5 browsers, the XHTML namespace must be used for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
| In XHTML, all XPath will require a namespace unless the elements genuinely have no namespace.&lt;br /&gt;
| &lt;br /&gt;
| Detect whether the browser is pre-HTML5 and omit namespaces in XPath expressions if so (otherwise, use a namespace).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! CSS Selectors&lt;br /&gt;
| Match case insensitively in HTML. &lt;br /&gt;
| Match case sensitively in XHTML&lt;br /&gt;
| &lt;br /&gt;
| For polyglot documents, use lower-case selectors or as appropriate (e.g., for SVG CamelCased items).&lt;br /&gt;
|-&lt;br /&gt;
! Styling of html/body elements&lt;br /&gt;
| CSS requires special handling of the body element in HTML for painting backgrounds on the canvas&lt;br /&gt;
| XHTML does not require special handling.&lt;br /&gt;
| &lt;br /&gt;
| Style the html and body elements appropriately (?).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7070</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7070"/>
		<updated>2011-08-21T12:01:55Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Scripts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type (which may or may not be determined by file extension) that determines what type of document you are using.  Any document served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, including a document authored with the intention of being XHTML, is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference can be upper-case.&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference cannot be upper-case.&lt;br /&gt;
|&lt;br /&gt;
| Only use the lower-case &#039;x&#039; for hexadecimal character references.&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Element(s)&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). &lt;br /&gt;
| In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML). &lt;br /&gt;
| There is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, if scripting is enabled, this element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element.&lt;br /&gt;
| In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &lt;br /&gt;
| &lt;br /&gt;
| Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements.&lt;br /&gt;
| In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not add content within these elements (or hide them on page load/DOMContentLoaded by JavaScript).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; when appearing out of context&lt;br /&gt;
| In HTML, the tags for these elements, when appearing out of context, are ignored. (How so?)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use these elements out of context. In the case of &amp;amp;lt;tr&amp;gt; directly inside a &amp;amp;lt;table&amp;gt;, one may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt;&lt;br /&gt;
| This element has a special parsing requirement in HTML. (It is, however, forbidden.) &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, a line feed that immediately follows any of these element&#039;s start tag is ignored. &lt;br /&gt;
| In XML, it is treated as other content.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Add any line break before the element begins using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| These elements are void elements in HTML. &lt;br /&gt;
| In XHTML, these may use explicit closing tags as well as self-closing ones (just as non-void elements can).&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use an explicit closing tag for these void elements to avoid double-inclusion when shown in HTML (and avoid self-closing tags on non-void elements which can sometimes accept content (such as &amp;amp;lt;script&amp;gt;)).&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; &lt;br /&gt;
| Available in HTML.&lt;br /&gt;
| These cannot be used in XHTML.&lt;br /&gt;
|&lt;br /&gt;
| Use DOM methods to replace or add content dynamically.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property&lt;br /&gt;
| Any HTML can be used.&lt;br /&gt;
| The use of this property requires that the string be a well-formed fragment of XML.&lt;br /&gt;
| &lt;br /&gt;
| Ensure one sets &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; to well-formed fragments. &lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! DOM APIs and case sensitivity&lt;br /&gt;
| Some DOM APIs are case insensitive in HTML (which are sensitive?). (This does not apply to elements which are not in the HTML namespace.)&lt;br /&gt;
| DOM APIs are case sensitive in XHTML&lt;br /&gt;
|&lt;br /&gt;
| Use lower-case elements, attributes, and attribute values (or as appropriate with SVG camel-cased elements and attributes (and the &amp;quot;definitionURL&amp;quot; attribute should use proper casing when used in MathML)).&lt;br /&gt;
|-&lt;br /&gt;
! Element.tagName and Node.nodeName properties&lt;br /&gt;
| These properties return the value in uppercase in HTML. (Node.localName is consistent now, as of HTML5.)&lt;br /&gt;
| These properties return the value in lower-case in XHTML.&lt;br /&gt;
|&lt;br /&gt;
| For older browsers, compare after converting to lower case.&lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() &lt;br /&gt;
| Case insensitive&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Element.setAttributeNode() &lt;br /&gt;
| Changes the attribute name to lowercase. &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Do not expect to use upper-case attribute names.&lt;br /&gt;
|-&lt;br /&gt;
! Element.setAttribute()&lt;br /&gt;
| Case insensitive &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Document.getElementsByTagName() and Element.getElementsByTagName() &lt;br /&gt;
| Case insensitive in HTML&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Document.renameNode()&lt;br /&gt;
| If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Do not expect to keep upper-case attribute names for HTML-namespaced elements after a rename.&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() and namespaces&lt;br /&gt;
| In HTML, this will create an element in the HTML namespace.&lt;br /&gt;
| In XML (including true XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
| In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
| &#039;&#039;&#039;If operating within a browser which supports it, use Document.createElementNS to avoid the ambiguity.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! XPath expressions&lt;br /&gt;
| In pre-HTML5 browsers, the XHTML namespace must be used for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
| In XHTML, all XPath will require a namespace unless the elements genuinely have no namespace.&lt;br /&gt;
| &lt;br /&gt;
| Detect whether the browser is pre-HTML5 and omit namespaces in XPath expressions if so (otherwise, use a namespace).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! CSS Selectors&lt;br /&gt;
| Match case insensitively in HTML. &lt;br /&gt;
| Match case sensitively in XHTML&lt;br /&gt;
| &lt;br /&gt;
| For polyglot documents, use lower-case selectors or as appropriate (e.g., for SVG CamelCased items).&lt;br /&gt;
|-&lt;br /&gt;
! Styling of html/body elements&lt;br /&gt;
| CSS requires special handling of the body element in HTML for painting backgrounds on the canvas&lt;br /&gt;
| XHTML does not require special handling.&lt;br /&gt;
| &lt;br /&gt;
| Style the html and body elements appropriately (?).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7069</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7069"/>
		<updated>2011-08-21T11:59:14Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Scripts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type (which may or may not be determined by file extension) that determines what type of document you are using.  Any document served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, including a document authored with the intention of being XHTML, is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference can be upper-case.&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference cannot be upper-case.&lt;br /&gt;
|&lt;br /&gt;
| Only use the lower-case &#039;x&#039; for hexadecimal character references.&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Element(s)&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). &lt;br /&gt;
| In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML). &lt;br /&gt;
| There is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, if scripting is enabled, this element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element.&lt;br /&gt;
| In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &lt;br /&gt;
| &lt;br /&gt;
| Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements.&lt;br /&gt;
| In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not add content within these elements (or hide them on page load/DOMContentLoaded by JavaScript).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; when appearing out of context&lt;br /&gt;
| In HTML, the tags for these elements, when appearing out of context, are ignored. (How so?)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use these elements out of context. In the case of &amp;amp;lt;tr&amp;gt; directly inside a &amp;amp;lt;table&amp;gt;, one may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt;&lt;br /&gt;
| This element has a special parsing requirement in HTML. (It is, however, forbidden.) &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, a line feed that immediately follows any of these element&#039;s start tag is ignored. &lt;br /&gt;
| In XML, it is treated as other content.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Add any line break before the element begins using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| These elements are void elements in HTML. &lt;br /&gt;
| In XHTML, these may use explicit closing tags as well as self-closing ones (just as non-void elements can).&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use an explicit closing tag for these void elements to avoid double-inclusion when shown in HTML (and avoid self-closing tags on non-void elements which can sometimes accept content (such as &amp;amp;lt;script&amp;gt;)).&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; &lt;br /&gt;
| Available in HTML.&lt;br /&gt;
| These cannot be used in XHTML.&lt;br /&gt;
|&lt;br /&gt;
| Use DOM methods to replace or add content dynamically.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property&lt;br /&gt;
| Any HTML can be used.&lt;br /&gt;
| The use of this property requires that the string be a well-formed fragment of XML.&lt;br /&gt;
| &lt;br /&gt;
| Ensure one sets &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; to well-formed fragments. &lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! DOM APIs and case sensitivity&lt;br /&gt;
| Some DOM APIs are case insensitive in HTML (which are sensitive?). (This does not apply to elements which are not in the HTML namespace.)&lt;br /&gt;
| DOM APIs are case sensitive in XHTML&lt;br /&gt;
|&lt;br /&gt;
| Use lower-case elements, attributes, and attribute values (or as appropriate with SVG camel-cased elements and attributes (and the &amp;quot;definitionURL&amp;quot; attribute should use proper casing when used in MathML)).&lt;br /&gt;
|-&lt;br /&gt;
! Element.tagName and Node.nodeName properties&lt;br /&gt;
| These properties return the value in uppercase in HTML. (Node.localName is consistent now, as of HTML5.)&lt;br /&gt;
| These properties return the value in lower-case in XHTML.&lt;br /&gt;
|&lt;br /&gt;
| For older browsers, compare after converting to lower case.&lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() &lt;br /&gt;
| Case insensitive&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Element.setAttributeNode() &lt;br /&gt;
| Changes the attribute name to lowercase. &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Do not expect to use upper-case attribute names.&lt;br /&gt;
|-&lt;br /&gt;
! Element.setAttribute()&lt;br /&gt;
| Case insensitive &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Document.getElementsByTagName() and Element.getElementsByTagName() &lt;br /&gt;
| Case insensitive in HTML&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
|-&lt;br /&gt;
! Document.renameNode()&lt;br /&gt;
| If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Do not expect to keep upper-case attribute names for HTML-namespaced elements after a rename.&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() and namespaces&lt;br /&gt;
| In HTML, this will create an element in the HTML namespace.&lt;br /&gt;
| In XML (including true XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
| In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
| &#039;&#039;&#039;If operating within a browser which supports it, use Document.createElementNS to avoid the ambiguity.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! XPath expressions&lt;br /&gt;
| In pre-HTML5 browsers, the XHTML namespace must be used for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
| In XHTML, all XPath will require a namespace.&lt;br /&gt;
| &lt;br /&gt;
| Detect whether the browser is pre-HTML5 and omit namespaces in XPath expressions if so (otherwise, use a namespace).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! CSS Selectors&lt;br /&gt;
| Match case insensitively in HTML. &lt;br /&gt;
| Match case sensitively in XHTML&lt;br /&gt;
| &lt;br /&gt;
| For polyglot documents, use lower-case selectors or as appropriate (e.g., for SVG CamelCased items).&lt;br /&gt;
|-&lt;br /&gt;
! Styling of html/body elements&lt;br /&gt;
| CSS requires special handling of the body element in HTML for painting backgrounds on the canvas&lt;br /&gt;
| XHTML does not require special handling.&lt;br /&gt;
| &lt;br /&gt;
| Style the html and body elements appropriately (?).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7068</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7068"/>
		<updated>2011-08-21T09:35:29Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* MIME Types */ clarification&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type (which may or may not be determined by file extension) that determines what type of document you are using.  Any document served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, including a document authored with the intention of being XHTML, is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference can be upper-case.&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference cannot be upper-case.&lt;br /&gt;
|&lt;br /&gt;
| Only use the lower-case &#039;x&#039; for hexadecimal character references.&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Element(s)&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). &lt;br /&gt;
| In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML). &lt;br /&gt;
| There is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, if scripting is enabled, this element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element.&lt;br /&gt;
| In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &lt;br /&gt;
| &lt;br /&gt;
| Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements.&lt;br /&gt;
| In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not add content within these elements (or hide them on page load/DOMContentLoaded by JavaScript).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; when appearing out of context&lt;br /&gt;
| In HTML, the tags for these elements, when appearing out of context, are ignored. (How so?)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use these elements out of context. In the case of &amp;amp;lt;tr&amp;gt; directly inside a &amp;amp;lt;table&amp;gt;, one may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt;&lt;br /&gt;
| This element has a special parsing requirement in HTML. (It is, however, forbidden.) &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, a line feed that immediately follows any of these element&#039;s start tag is ignored. &lt;br /&gt;
| In XML, it is treated as other content.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Add any line break before the element begins using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| These elements are void elements in HTML. &lt;br /&gt;
| In XHTML, these may use explicit closing tags as well as self-closing ones (just as non-void elements can).&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use an explicit closing tag for these void elements to avoid double-inclusion when shown in HTML (and avoid self-closing tags on non-void elements which can sometimes accept content (such as &amp;amp;lt;script&amp;gt;)).&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; &lt;br /&gt;
| Available in HTML.&lt;br /&gt;
| These cannot be used in XHTML.&lt;br /&gt;
|&lt;br /&gt;
| Use DOM methods to replace or add content dynamically.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property&lt;br /&gt;
| Any HTML can be used.&lt;br /&gt;
| The use of this property requires that the string be a well-formed fragment of XML.&lt;br /&gt;
| &lt;br /&gt;
| Ensure one sets &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; to well-formed fragments. &lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() and namespaces&lt;br /&gt;
| In HTML, this will create an element in the HTML namespace.&lt;br /&gt;
| In XML (including true XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
| In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
| &#039;&#039;&#039;If operating within a browser which supports it, use Document.createElementNS to avoid the ambiguity.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! XPath expressions&lt;br /&gt;
| In pre-HTML5 browsers, the XHTML namespace must be used for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
| In XHTML, all XPath will require a namespace.&lt;br /&gt;
| &lt;br /&gt;
| Detect whether the browser is pre-HTML5 and omit namespaces in XPath expressions if so (otherwise, use a namespace).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace.) Use lower-case (or as appropriate in SVG).&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5.) For older browsers, compare after converting to lower case.&lt;br /&gt;
** Document.createElement() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase. Do not expect to use upper-case attribute names.&lt;br /&gt;
** Element.setAttribute() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive in HTML. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place. Do not expect to use upper-case attribute names.&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! CSS Selectors&lt;br /&gt;
| Match case insensitively in HTML. &lt;br /&gt;
| Match case sensitively in XHTML&lt;br /&gt;
| &lt;br /&gt;
| For polyglot documents, use lower-case selectors or as appropriate (e.g., for SVG CamelCased items).&lt;br /&gt;
|-&lt;br /&gt;
! Styling of html/body elements&lt;br /&gt;
| CSS requires special handling of the body element in HTML for painting backgrounds on the canvas&lt;br /&gt;
| XHTML does not require special handling.&lt;br /&gt;
| &lt;br /&gt;
| Style the html and body elements appropriately (?).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7067</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7067"/>
		<updated>2011-08-21T09:32:46Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ fix table&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference can be upper-case.&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference cannot be upper-case.&lt;br /&gt;
|&lt;br /&gt;
| Only use the lower-case &#039;x&#039; for hexadecimal character references.&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Element(s)&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). &lt;br /&gt;
| In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML). &lt;br /&gt;
| There is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, if scripting is enabled, this element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element.&lt;br /&gt;
| In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &lt;br /&gt;
| &lt;br /&gt;
| Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements.&lt;br /&gt;
| In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not add content within these elements (or hide them on page load/DOMContentLoaded by JavaScript).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; when appearing out of context&lt;br /&gt;
| In HTML, the tags for these elements, when appearing out of context, are ignored. (How so?)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use these elements out of context. In the case of &amp;amp;lt;tr&amp;gt; directly inside a &amp;amp;lt;table&amp;gt;, one may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt;&lt;br /&gt;
| This element has a special parsing requirement in HTML. (It is, however, forbidden.) &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, a line feed that immediately follows any of these element&#039;s start tag is ignored. &lt;br /&gt;
| In XML, it is treated as other content.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Add any line break before the element begins using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| These elements are void elements in HTML. &lt;br /&gt;
| In XHTML, these may use explicit closing tags as well as self-closing ones (just as non-void elements can).&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use an explicit closing tag for these void elements to avoid double-inclusion when shown in HTML (and avoid self-closing tags on non-void elements which can sometimes accept content (such as &amp;amp;lt;script&amp;gt;)).&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; &lt;br /&gt;
| Available in HTML.&lt;br /&gt;
| These cannot be used in XHTML.&lt;br /&gt;
|&lt;br /&gt;
| Use DOM methods to replace or add content dynamically.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property&lt;br /&gt;
| Any HTML can be used.&lt;br /&gt;
| The use of this property requires that the string be a well-formed fragment of XML.&lt;br /&gt;
| &lt;br /&gt;
| Ensure one sets &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; to well-formed fragments. &lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() and namespaces&lt;br /&gt;
| In HTML, this will create an element in the HTML namespace.&lt;br /&gt;
| In XML (including true XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
| In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
| &#039;&#039;&#039;If operating within a browser which supports it, use Document.createElementNS to avoid the ambiguity.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! XPath expressions&lt;br /&gt;
| In pre-HTML5 browsers, the XHTML namespace must be used for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
| In XHTML, all XPath will require a namespace.&lt;br /&gt;
| &lt;br /&gt;
| Detect whether the browser is pre-HTML5 and omit namespaces in XPath expressions if so (otherwise, use a namespace).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace.) Use lower-case (or as appropriate in SVG).&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5.) For older browsers, compare after converting to lower case.&lt;br /&gt;
** Document.createElement() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase. Do not expect to use upper-case attribute names.&lt;br /&gt;
** Element.setAttribute() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive in HTML. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place. Do not expect to use upper-case attribute names.&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! CSS Selectors&lt;br /&gt;
| Match case insensitively in HTML. &lt;br /&gt;
| Match case sensitively in XHTML&lt;br /&gt;
| &lt;br /&gt;
| For polyglot documents, use lower-case selectors or as appropriate (e.g., for SVG CamelCased items).&lt;br /&gt;
|-&lt;br /&gt;
! Styling of html/body elements&lt;br /&gt;
| CSS requires special handling of the body element in HTML for painting backgrounds on the canvas&lt;br /&gt;
| XHTML does not require special handling.&lt;br /&gt;
| &lt;br /&gt;
| Style the html and body elements appropriately (?).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7066</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7066"/>
		<updated>2011-08-21T09:31:47Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ Fix table and add info on char. refs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference can be upper-case.&lt;br /&gt;
| The &#039;x&#039; in a hexadecimal character reference cannot be upper-case.&lt;br /&gt;
|&lt;br /&gt;
| Only use the lower-case &#039;x&#039; for hexadecimal character references.&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Element(s)&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). &lt;br /&gt;
| In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML). &lt;br /&gt;
| There is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, if scripting is enabled, this element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element.&lt;br /&gt;
| In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &lt;br /&gt;
| &lt;br /&gt;
| Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements.&lt;br /&gt;
| In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not add content within these elements (or hide them on page load/DOMContentLoaded by JavaScript).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; when appearing out of context&lt;br /&gt;
| In HTML, the tags for these elements, when appearing out of context, are ignored. (How so?)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use these elements out of context. In the case of &amp;amp;lt;tr&amp;gt; directly inside a &amp;amp;lt;table&amp;gt;, one may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt;&lt;br /&gt;
| This element has a special parsing requirement in HTML. (It is, however, forbidden.) &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, a line feed that immediately follows any of these element&#039;s start tag is ignored. &lt;br /&gt;
| In XML, it is treated as other content.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Add any line break before the element begins using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| These elements are void elements in HTML. &lt;br /&gt;
| In XHTML, these may use explicit closing tags as well as self-closing ones (just as non-void elements can).&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use an explicit closing tag for these void elements to avoid double-inclusion when shown in HTML (and avoid self-closing tags on non-void elements which can sometimes accept content (such as &amp;amp;lt;script&amp;gt;)).&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; &lt;br /&gt;
| Available in HTML.&lt;br /&gt;
| These cannot be used in XHTML.&lt;br /&gt;
|&lt;br /&gt;
| Use DOM methods to replace or add content dynamically.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property&lt;br /&gt;
| Any HTML can be used.&lt;br /&gt;
| The use of this property requires that the string be a well-formed fragment of XML.&lt;br /&gt;
| &lt;br /&gt;
| Ensure one sets &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; to well-formed fragments. &lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() and namespaces&lt;br /&gt;
| In HTML, this will create an element in the HTML namespace.&lt;br /&gt;
| In XML (including true XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
| In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
| &#039;&#039;&#039;If operating within a browser which supports it, use Document.createElementNS to avoid the ambiguity.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! XPath expressions&lt;br /&gt;
| In pre-HTML5 browsers, the XHTML namespace must be used for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
| In XHTML, all XPath will require a namespace.&lt;br /&gt;
| &lt;br /&gt;
| Detect whether the browser is pre-HTML5 and omit namespaces in XPath expressions if so (otherwise, use a namespace).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace.) Use lower-case (or as appropriate in SVG).&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5.) For older browsers, compare after converting to lower case.&lt;br /&gt;
** Document.createElement() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase. Do not expect to use upper-case attribute names.&lt;br /&gt;
** Element.setAttribute() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive in HTML. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place. Do not expect to use upper-case attribute names.&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! CSS Selectors&lt;br /&gt;
| Match case insensitively in HTML. &lt;br /&gt;
| Match case sensitively in XHTML&lt;br /&gt;
| &lt;br /&gt;
| For polyglot documents, use lower-case selectors or as appropriate (e.g., for SVG CamelCased items).&lt;br /&gt;
|-&lt;br /&gt;
! Styling of html/body elements&lt;br /&gt;
| CSS requires special handling of the body element in HTML for painting backgrounds on the canvas&lt;br /&gt;
| XHTML does not require special handling.&lt;br /&gt;
| &lt;br /&gt;
| Style the html and body elements appropriately (?).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7065</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7065"/>
		<updated>2011-08-21T09:28:02Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Scripts */ periods&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Element(s)&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). &lt;br /&gt;
| In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML). &lt;br /&gt;
| There is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, if scripting is enabled, this element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element.&lt;br /&gt;
| In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &lt;br /&gt;
| &lt;br /&gt;
| Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements.&lt;br /&gt;
| In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not add content within these elements (or hide them on page load/DOMContentLoaded by JavaScript).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; when appearing out of context&lt;br /&gt;
| In HTML, the tags for these elements, when appearing out of context, are ignored. (How so?)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use these elements out of context. In the case of &amp;amp;lt;tr&amp;gt; directly inside a &amp;amp;lt;table&amp;gt;, one may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt;&lt;br /&gt;
| This element has a special parsing requirement in HTML. (It is, however, forbidden.) &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, a line feed that immediately follows any of these element&#039;s start tag is ignored. &lt;br /&gt;
| In XML, it is treated as other content.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Add any line break before the element begins using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| These elements are void elements in HTML. &lt;br /&gt;
| In XHTML, these may use explicit closing tags as well as self-closing ones (just as non-void elements can).&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use an explicit closing tag for these void elements to avoid double-inclusion when shown in HTML (and avoid self-closing tags on non-void elements which can sometimes accept content (such as &amp;amp;lt;script&amp;gt;)).&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; &lt;br /&gt;
| Available in HTML.&lt;br /&gt;
| These cannot be used in XHTML.&lt;br /&gt;
|&lt;br /&gt;
| Use DOM methods to replace or add content dynamically.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property&lt;br /&gt;
| Any HTML can be used.&lt;br /&gt;
| The use of this property requires that the string be a well-formed fragment of XML.&lt;br /&gt;
| &lt;br /&gt;
| Ensure one sets &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; to well-formed fragments. &lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() and namespaces&lt;br /&gt;
| In HTML, this will create an element in the HTML namespace.&lt;br /&gt;
| In XML (including true XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
| In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
| &#039;&#039;&#039;If operating within a browser which supports it, use Document.createElementNS to avoid the ambiguity.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! XPath expressions&lt;br /&gt;
| In pre-HTML5 browsers, the XHTML namespace must be used for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
| In XHTML, all XPath will require a namespace.&lt;br /&gt;
| &lt;br /&gt;
| Detect whether the browser is pre-HTML5 and omit namespaces in XPath expressions if so (otherwise, use a namespace).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace.) Use lower-case (or as appropriate in SVG).&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5.) For older browsers, compare after converting to lower case.&lt;br /&gt;
** Document.createElement() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase. Do not expect to use upper-case attribute names.&lt;br /&gt;
** Element.setAttribute() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive in HTML. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place. Do not expect to use upper-case attribute names.&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! CSS Selectors&lt;br /&gt;
| Match case insensitively in HTML. &lt;br /&gt;
| Match case sensitively in XHTML&lt;br /&gt;
| &lt;br /&gt;
| For polyglot documents, use lower-case selectors or as appropriate (e.g., for SVG CamelCased items).&lt;br /&gt;
|-&lt;br /&gt;
! Styling of html/body elements&lt;br /&gt;
| CSS requires special handling of the body element in HTML for painting backgrounds on the canvas&lt;br /&gt;
| XHTML does not require special handling.&lt;br /&gt;
| &lt;br /&gt;
| Style the html and body elements appropriately (?).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7064</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7064"/>
		<updated>2011-08-21T09:27:15Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Scripts */ starting table&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Element(s)&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). &lt;br /&gt;
| In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML). &lt;br /&gt;
| There is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, if scripting is enabled, this element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element.&lt;br /&gt;
| In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &lt;br /&gt;
| &lt;br /&gt;
| Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements.&lt;br /&gt;
| In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not add content within these elements (or hide them on page load/DOMContentLoaded by JavaScript).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; when appearing out of context&lt;br /&gt;
| In HTML, the tags for these elements, when appearing out of context, are ignored. (How so?)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use these elements out of context. In the case of &amp;amp;lt;tr&amp;gt; directly inside a &amp;amp;lt;table&amp;gt;, one may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt;&lt;br /&gt;
| This element has a special parsing requirement in HTML. (It is, however, forbidden.) &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, a line feed that immediately follows any of these element&#039;s start tag is ignored. &lt;br /&gt;
| In XML, it is treated as other content.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Add any line break before the element begins using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| These elements are void elements in HTML. &lt;br /&gt;
| In XHTML, these may use explicit closing tags as well as self-closing ones (just as non-void elements can).&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use an explicit closing tag for these void elements to avoid double-inclusion when shown in HTML (and avoid self-closing tags on non-void elements which can sometimes accept content (such as &amp;amp;lt;script&amp;gt;)).&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; &lt;br /&gt;
| Available in HTML&lt;br /&gt;
| These cannot be used in XHTML&lt;br /&gt;
|&lt;br /&gt;
| Use DOM methods to replace or add content dynamically.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property&lt;br /&gt;
| Any HTML can be used&lt;br /&gt;
| The use of this property requires that the string be a well-formed fragment of XML.&lt;br /&gt;
| &lt;br /&gt;
| Ensure one sets &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; to well-formed fragments. &lt;br /&gt;
|-&lt;br /&gt;
! Document.createElement() and namespaces&lt;br /&gt;
| In HTML, this will create an element in the HTML namespace.&lt;br /&gt;
| In XML (including true XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
| In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
| &#039;&#039;&#039;If operating within a browser which supports it, use Document.createElementNS to avoid the ambiguity.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! XPath expressions&lt;br /&gt;
| In pre-HTML5 browsers, the XHTML namespace must be used for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
| In XHTML, all XPath will require a namespace&lt;br /&gt;
| &lt;br /&gt;
| Detect whether the browser is pre-HTML5 and omit namespaces in XPath expressions if so (otherwise, use a namespace).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace.) Use lower-case (or as appropriate in SVG).&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5.) For older browsers, compare after converting to lower case.&lt;br /&gt;
** Document.createElement() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase. Do not expect to use upper-case attribute names.&lt;br /&gt;
** Element.setAttribute() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive in HTML. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place. Do not expect to use upper-case attribute names.&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! CSS Selectors&lt;br /&gt;
| Match case insensitively in HTML. &lt;br /&gt;
| Match case sensitively in XHTML&lt;br /&gt;
| &lt;br /&gt;
| For polyglot documents, use lower-case selectors or as appropriate (e.g., for SVG CamelCased items).&lt;br /&gt;
|-&lt;br /&gt;
! Styling of html/body elements&lt;br /&gt;
| CSS requires special handling of the body element in HTML for painting backgrounds on the canvas&lt;br /&gt;
| XHTML does not require special handling.&lt;br /&gt;
| &lt;br /&gt;
| Style the html and body elements appropriately (?).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7063</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7063"/>
		<updated>2011-08-21T09:11:42Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Stylesheets */ make into table&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Element(s)&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). &lt;br /&gt;
| In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML). &lt;br /&gt;
| There is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, if scripting is enabled, this element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element.&lt;br /&gt;
| In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &lt;br /&gt;
| &lt;br /&gt;
| Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements.&lt;br /&gt;
| In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not add content within these elements (or hide them on page load/DOMContentLoaded by JavaScript).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; when appearing out of context&lt;br /&gt;
| In HTML, the tags for these elements, when appearing out of context, are ignored. (How so?)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use these elements out of context. In the case of &amp;amp;lt;tr&amp;gt; directly inside a &amp;amp;lt;table&amp;gt;, one may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt;&lt;br /&gt;
| This element has a special parsing requirement in HTML. (It is, however, forbidden.) &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, a line feed that immediately follows any of these element&#039;s start tag is ignored. &lt;br /&gt;
| In XML, it is treated as other content.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Add any line break before the element begins using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| These elements are void elements in HTML. &lt;br /&gt;
| In XHTML, these may use explicit closing tags as well as self-closing ones (just as non-void elements can).&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use an explicit closing tag for these void elements to avoid double-inclusion when shown in HTML (and avoid self-closing tags on non-void elements which can sometimes accept content (such as &amp;amp;lt;script&amp;gt;)).&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. Use DOM methods to replace or add content dynamically.&lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. Ensure one sets &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; to well-formed fragments. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace.) Use lower-case (or as appropriate in SVG).&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5.) For older browsers, compare after converting to lower case.&lt;br /&gt;
** Document.createElement() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase. Do not expect to use upper-case attribute names.&lt;br /&gt;
** Element.setAttribute() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive in HTML. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place. Do not expect to use upper-case attribute names.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! CSS Selectors&lt;br /&gt;
| Match case insensitively in HTML. &lt;br /&gt;
| Match case sensitively in XHTML&lt;br /&gt;
| &lt;br /&gt;
| For polyglot documents, use lower-case selectors or as appropriate (e.g., for SVG CamelCased items).&lt;br /&gt;
|-&lt;br /&gt;
! Styling of html/body elements&lt;br /&gt;
| CSS requires special handling of the body element in HTML for painting backgrounds on the canvas&lt;br /&gt;
| XHTML does not require special handling.&lt;br /&gt;
| &lt;br /&gt;
| Style the html and body elements appropriately (?).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7062</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7062"/>
		<updated>2011-08-21T09:08:43Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Element-specific parsing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Element(s)&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). &lt;br /&gt;
| In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML). &lt;br /&gt;
| There is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, if scripting is enabled, this element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element.&lt;br /&gt;
| In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &lt;br /&gt;
| &lt;br /&gt;
| Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements.&lt;br /&gt;
| In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not add content within these elements (or hide them on page load/DOMContentLoaded by JavaScript).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; when appearing out of context&lt;br /&gt;
| In HTML, the tags for these elements, when appearing out of context, are ignored. (How so?)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use these elements out of context. In the case of &amp;amp;lt;tr&amp;gt; directly inside a &amp;amp;lt;table&amp;gt;, one may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt;&lt;br /&gt;
| This element has a special parsing requirement in HTML. (It is, however, forbidden.) &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, a line feed that immediately follows any of these element&#039;s start tag is ignored. &lt;br /&gt;
| In XML, it is treated as other content.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Add any line break before the element begins using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| These elements are void elements in HTML. &lt;br /&gt;
| In XHTML, these may use explicit closing tags as well as self-closing ones (just as non-void elements can).&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use an explicit closing tag for these void elements to avoid double-inclusion when shown in HTML (and avoid self-closing tags on non-void elements which can sometimes accept content (such as &amp;amp;lt;script&amp;gt;)).&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. Use DOM methods to replace or add content dynamically.&lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. Ensure one sets &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; to well-formed fragments. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace.) Use lower-case (or as appropriate in SVG).&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5.) For older browsers, compare after converting to lower case.&lt;br /&gt;
** Document.createElement() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase. Do not expect to use upper-case attribute names.&lt;br /&gt;
** Element.setAttribute() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive in HTML. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place. Do not expect to use upper-case attribute names.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML. For polyglot documents, use lower-case selectors or as appropriate (e.g., for SVG CamelCased items).&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* Style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7061</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7061"/>
		<updated>2011-08-21T09:06:26Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Element-specific parsing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Element(s)&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). &lt;br /&gt;
| In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML). &lt;br /&gt;
| There is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML&lt;br /&gt;
| &lt;br /&gt;
| Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, if scripting is enabled, this element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element.&lt;br /&gt;
| In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &lt;br /&gt;
| &lt;br /&gt;
| Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, these elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements.&lt;br /&gt;
| In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not add content within these elements (or hide them on page load/DOMContentLoaded by JavaScript).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; when appearing out of context&lt;br /&gt;
| In HTML, the tags for these elements, when appearing out of context, are ignored. (How so?)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use these elements out of context. In the case of &amp;amp;lt;tr&amp;gt; directly inside a &amp;amp;lt;table&amp;gt;, one may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt;&lt;br /&gt;
| This element has a special parsing requirement in HTML. (It is, however, forbidden.) &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
| In HTML, a line feed that immediately follows any of these element&#039;s start tag is ignored. &lt;br /&gt;
| In XML, it is treated as other content.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Add any line break before the element begins using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| These elements are void elements in HTML. &lt;br /&gt;
| In XHTML, these may use explicit closing tags as well as self-closing ones (just as non-void elements can).&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Do not use an explicit closing tag for these void elements to avoid double-inclusion when shown in HTML (and avoid self-closing tags on non-void elements which can sometimes accept content (such as &amp;amp;lt;script&amp;gt;)).&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. Use DOM methods to replace or add content dynamically.&lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. Ensure one sets &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; to well-formed fragments. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace.) Use lower-case (or as appropriate in SVG).&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5.) For older browsers, compare after converting to lower case.&lt;br /&gt;
** Document.createElement() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase. Do not expect to use upper-case attribute names.&lt;br /&gt;
** Element.setAttribute() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive in HTML. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place. Do not expect to use upper-case attribute names.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML. For polyglot documents, use lower-case selectors or as appropriate (e.g., for SVG CamelCased items).&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* Style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7060</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7060"/>
		<updated>2011-08-21T08:30:30Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Scripts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML). &#039;&#039;&#039;Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&#039;&#039;&#039;&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &#039;&#039;&#039;Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&#039;&#039;&#039;&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &#039;&#039;&#039;Do not add content for these elements or hide them by JavaScript.&#039;&#039;&#039;&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;. &#039;&#039;&#039;Do not use these elements out of context.&#039;&#039;&#039;&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation). &#039;&#039;&#039;One may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.) &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored. &#039;&#039;&#039;Add line breaks before the element using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;). &#039;&#039;&#039;Always use the self-closing version of these tags to avoid double-inclusion in HTML.&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. Use DOM methods to replace or add content dynamically.&lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. Ensure one sets &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; to well-formed fragments. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace.) Use lower-case (or as appropriate in SVG).&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5.) For older browsers, compare after converting to lower case.&lt;br /&gt;
** Document.createElement() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase. Do not expect to use upper-case attribute names.&lt;br /&gt;
** Element.setAttribute() is case insensitive. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive in HTML. Use the canonical form, lowercase, for polyglot documents.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place. Do not expect to use upper-case attribute names.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML. For polyglot documents, use lower-case selectors or as appropriate (e.g., for SVG CamelCased items).&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* Style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7059</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7059"/>
		<updated>2011-08-21T08:16:39Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Stylesheets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML). &#039;&#039;&#039;Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&#039;&#039;&#039;&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &#039;&#039;&#039;Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&#039;&#039;&#039;&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &#039;&#039;&#039;Do not add content for these elements or hide them by JavaScript.&#039;&#039;&#039;&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;. &#039;&#039;&#039;Do not use these elements out of context.&#039;&#039;&#039;&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation). &#039;&#039;&#039;One may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.) &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored. &#039;&#039;&#039;Add line breaks before the element using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;). &#039;&#039;&#039;Always use the self-closing version of these tags to avoid double-inclusion in HTML.&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML. For polyglot documents, use lower-case selectors or as appropriate (e.g., for SVG CamelCased items).&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* Style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7058</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7058"/>
		<updated>2011-08-21T08:14:32Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* HTML Elements with Optional Tags */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML). &#039;&#039;&#039;Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&#039;&#039;&#039;&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &#039;&#039;&#039;Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&#039;&#039;&#039;&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &#039;&#039;&#039;Do not add content for these elements or hide them by JavaScript.&#039;&#039;&#039;&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;. &#039;&#039;&#039;Do not use these elements out of context.&#039;&#039;&#039;&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation). &#039;&#039;&#039;One may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.) &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored. &#039;&#039;&#039;Add line breaks before the element using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;). &#039;&#039;&#039;Always use the self-closing version of these tags to avoid double-inclusion in HTML.&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For polyglot texts, always use the start and ending tag (unless it is a void element, in which case, self-closing tags must be used).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7057</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7057"/>
		<updated>2011-08-21T08:12:51Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ make possible exception to avoiding CDATA&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections (except possibly for script and style tags--see element-specific behavior below).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML). &#039;&#039;&#039;Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&#039;&#039;&#039;&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &#039;&#039;&#039;Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&#039;&#039;&#039;&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &#039;&#039;&#039;Do not add content for these elements or hide them by JavaScript.&#039;&#039;&#039;&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;. &#039;&#039;&#039;Do not use these elements out of context.&#039;&#039;&#039;&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation). &#039;&#039;&#039;One may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.) &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored. &#039;&#039;&#039;Add line breaks before the element using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;). &#039;&#039;&#039;Always use the self-closing version of these tags to avoid double-inclusion in HTML.&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7056</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7056"/>
		<updated>2011-08-21T08:11:38Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Element-specific parsing */ move underspecified item to end&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML). &#039;&#039;&#039;Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&#039;&#039;&#039;&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &#039;&#039;&#039;Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&#039;&#039;&#039;&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &#039;&#039;&#039;Do not add content for these elements or hide them by JavaScript.&#039;&#039;&#039;&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;. &#039;&#039;&#039;Do not use these elements out of context.&#039;&#039;&#039;&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation). &#039;&#039;&#039;One may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.) &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored. &#039;&#039;&#039;Add line breaks before the element using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;). &#039;&#039;&#039;Always use the self-closing version of these tags to avoid double-inclusion in HTML.&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7055</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7055"/>
		<updated>2011-08-21T08:10:36Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Element-specific parsing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The following code with escaping can ensure script and style elements will work in both XHTML and HTML, including older browsers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML). &#039;&#039;&#039;Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require them (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&#039;&#039;&#039;&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled. &#039;&#039;&#039;Add content to the page which should be shown when JavaScript is disabled and use JavaScript to hide these elements when the page has loaded (DOMContentLoaded can be used for modern browsers).&#039;&#039;&#039;&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used. &#039;&#039;&#039;Do not add content for these elements or hide them by JavaScript.&#039;&#039;&#039;&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;. &#039;&#039;&#039;Do not use these elements out of context.&#039;&#039;&#039;&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation). &#039;&#039;&#039;One may use an explicit tbody to avoid potential confusion.&#039;&#039;&#039;&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.) &#039;&#039;&#039;Do not use plaintext.&#039;&#039;&#039;&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored. &#039;&#039;&#039;Add line breaks before the element using HTML or CSS.&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;). &#039;&#039;&#039;Always use the self-closing version of these tags to avoid double-inclusion in HTML.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7054</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7054"/>
		<updated>2011-08-21T07:53:45Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Element-specific parsing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
&lt;br /&gt;
The following ensures script and style elements will work in both XHTML and HTML, including older browsers.&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML). &#039;&#039;&#039;Use &amp;amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&#039;&#039;&#039;.&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7053</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7053"/>
		<updated>2011-08-21T07:52:32Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Element-specific parsing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
&lt;br /&gt;
The following ensures script and style elements will work in both XHTML and HTML, including older browsers.&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML). &#039;&#039;&#039;Use &amp;amp;amp; and &amp;amp;amp;lt; escape forms (and &amp;quot;]]&amp;amp;amp;gt;&amp;quot; if the sequence &amp;quot;]]&amp;gt;&amp;quot; is required) within these elements even though HTML does not require (CDATA sections apparently cannot be added here in a polyglot-supportive fashion).&#039;&#039;&#039;.&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7052</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7052"/>
		<updated>2011-08-21T07:28:54Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Element-specific parsing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
&lt;br /&gt;
The following ensures script and style elements will work in both XHTML and HTML, including older browsers.&lt;br /&gt;
&lt;br /&gt;
In both cases, XML ignores the first comment and then uses the CDATA section to avoid the need for escaping special characters &amp;lt; and &amp;amp; within the rest of the contents (with subsequent JavaScript comments added within to ensure the HTML-oriented code is ignored by JavaScript).&lt;br /&gt;
&lt;br /&gt;
In HTML, older browsers might display the content without the content being within a comment, so comments are used to hide this from them (while modern HTML browsers will run code inside the comments). The subsequent JavaScript comment is added to negate the text added for the sake of XHTML.&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;style&amp;gt; requires the /**/ comments since CSS does not support the single line ones.&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;amp;lt;!--//--&amp;gt;&amp;amp;lt;![CDATA[//&amp;gt;&amp;amp;lt;!--&lt;br /&gt;
        ...&lt;br /&gt;
    //--&amp;gt;&amp;amp;lt;!]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;amp;lt;!--/*--&amp;gt;&amp;amp;lt;![CDATA[/*&amp;gt;&amp;amp;lt;!--*/&lt;br /&gt;
        ...&lt;br /&gt;
    /*]]&amp;gt;*/--&amp;gt;&amp;amp;lt;/style&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If not concerned about much older browsers (from which one is hiding the HTML) one can use the simpler:&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;script&amp;gt;//&amp;amp;lt;![CDATA[&lt;br /&gt;
    &lt;br /&gt;
    //]]&amp;gt;&amp;amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;style&amp;gt;/*&amp;amp;lt;![CDATA[*/&lt;br /&gt;
    &lt;br /&gt;
    /*]]&amp;gt;*/&amp;amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the sequence &amp;quot;]]&amp;gt;&amp;quot; is not allowed within a CDATA section, so it cannot be used in true XHTML-embedded JavaScript without escaping.&lt;br /&gt;
&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7051</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=7051"/>
		<updated>2011-08-21T06:56:31Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Element-specific parsing */ link and meta allowed in body now&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, and now also &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dd&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=6389</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=6389"/>
		<updated>2011-05-02T02:16:46Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Differences Between HTML and XHTML */ +w3c link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
The document at http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html provides a similar analysis.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4984</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4984"/>
		<updated>2010-06-26T08:25:48Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ +element content&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values (or elements with exclusively element content) in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4983</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4983"/>
		<updated>2010-06-26T08:10:19Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ empty namespaced elements in HTML guidance&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;. You should explicitly close (not self-close) all empty elements defined in a non-XHTML namespace, since otherwise when used in HTML, HTML will treat them as though they have not been closed.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4982</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4982"/>
		<updated>2010-06-26T08:07:51Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ namespaced elements are non-void as far as HTML is concerned&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements (and be aware that self-closing elements cannot be used as such since unrecognized elements will be treated as though they are non-void; thus one cannot, for example, type &amp;lt;code&amp;gt;&amp;lt;caesura /&amp;gt;&amp;lt;/code&amp;gt; in HTML or it will be treated as though there is no immediate closing tag). Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4981</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4981"/>
		<updated>2010-06-26T08:03:02Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ non-namespaced, non-HTML attributes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements. Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value).&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed. &lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes. Non-namespaced attributes not belonging to HTML will be included in the DOM tree and accessible to script and stylesheets, but it is discouraged to use these due to the potential for future naming conflicts; &amp;lt;code&amp;gt;data-&amp;lt;/code&amp;gt; attributes can be used instead, or if in an XML-only environment, namespaced attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4980</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4980"/>
		<updated>2010-06-26T07:56:06Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ +prefixing of XHTML elements&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements. Namespaced prefixes are not allowed on HTML elements; a prefixed xmlns attribute cannot be used even if it is defined in the XHTML namespace.&lt;br /&gt;
| The XHTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly and do not prefix XHTML elements. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4979</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4979"/>
		<updated>2010-06-26T07:50:05Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Element-specific parsing */ rmv on optional tags as in tables&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements.&lt;br /&gt;
| The HTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4978</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4978"/>
		<updated>2010-06-26T07:48:09Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Element-specific parsing */ void elements already in table&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements.&lt;br /&gt;
| The HTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
* The following are void elements in HTML (see void elements in table): In head (&amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;), in body (&amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4977</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4977"/>
		<updated>2010-06-26T07:45:34Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Element-specific parsing */ such as?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements.&lt;br /&gt;
| The HTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt; (such as?)&lt;br /&gt;
* In XHTML, empty elements may use either the empty element syntax (&amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;) or have an end tag immediately follow the start tag (&amp;lt;code&amp;gt;&amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/br&amp;amp;gt;&amp;lt;/code&amp;gt;). In HTML, the empty element syntax (trailing slash) is allowed on void elements, but forbidden on other elements. However, it serves no purpose whatsoever and can be omitted. End tags for void elements are forbidden.&lt;br /&gt;
** &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4976</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4976"/>
		<updated>2010-06-26T07:44:31Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ xlink&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements.&lt;br /&gt;
| The HTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use XLink attributes on HTML elements and do not depend on them on foreign elements as will not work as such in HTML.&#039;&#039;&#039; If being used, ensure they have the appropriate XLink namespace defined.&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt;&lt;br /&gt;
* In XHTML, empty elements may use either the empty element syntax (&amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;) or have an end tag immediately follow the start tag (&amp;lt;code&amp;gt;&amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/br&amp;amp;gt;&amp;lt;/code&amp;gt;). In HTML, the empty element syntax (trailing slash) is allowed on void elements, but forbidden on other elements. However, it serves no purpose whatsoever and can be omitted. End tags for void elements are forbidden.&lt;br /&gt;
** &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4975</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4975"/>
		<updated>2010-06-26T07:41:43Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML and thus trigger no quirks parsing.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements.&lt;br /&gt;
| The HTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt;&lt;br /&gt;
* In XHTML, empty elements may use either the empty element syntax (&amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;) or have an end tag immediately follow the start tag (&amp;lt;code&amp;gt;&amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/br&amp;amp;gt;&amp;lt;/code&amp;gt;). In HTML, the empty element syntax (trailing slash) is allowed on void elements, but forbidden on other elements. However, it serves no purpose whatsoever and can be omitted. End tags for void elements are forbidden.&lt;br /&gt;
** &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4974</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4974"/>
		<updated>2010-06-26T07:41:05Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ +guidance on quirks mode&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string, respectively.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
| &#039;&#039;&#039;Use an explicit &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; for the sake of HTML.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements.&lt;br /&gt;
| The HTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt;&lt;br /&gt;
* In XHTML, empty elements may use either the empty element syntax (&amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;) or have an end tag immediately follow the start tag (&amp;lt;code&amp;gt;&amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/br&amp;amp;gt;&amp;lt;/code&amp;gt;). In HTML, the empty element syntax (trailing slash) is allowed on void elements, but forbidden on other elements. However, it serves no purpose whatsoever and can be omitted. End tags for void elements are forbidden.&lt;br /&gt;
** &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4973</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4973"/>
		<updated>2010-06-26T07:37:35Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Stylesheets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements.&lt;br /&gt;
| The HTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt;&lt;br /&gt;
* In XHTML, empty elements may use either the empty element syntax (&amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;) or have an end tag immediately follow the start tag (&amp;lt;code&amp;gt;&amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/br&amp;amp;gt;&amp;lt;/code&amp;gt;). In HTML, the empty element syntax (trailing slash) is allowed on void elements, but forbidden on other elements. However, it serves no purpose whatsoever and can be omitted. End tags for void elements are forbidden.&lt;br /&gt;
** &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
* For polyglot documents, use lower-case element selectors and style the html and body elements appropriately (?).&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4972</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4972"/>
		<updated>2010-06-26T07:35:54Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Scripts */ localName&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements.&lt;br /&gt;
| The HTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt;&lt;br /&gt;
* In XHTML, empty elements may use either the empty element syntax (&amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;) or have an end tag immediately follow the start tag (&amp;lt;code&amp;gt;&amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/br&amp;amp;gt;&amp;lt;/code&amp;gt;). In HTML, the empty element syntax (trailing slash) is allowed on void elements, but forbidden on other elements. However, it serves no purpose whatsoever and can be omitted. End tags for void elements are forbidden.&lt;br /&gt;
** &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase in HTML but lower-case in XHTML (Node.localName is consistent now, as of HTML5).&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4971</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4971"/>
		<updated>2010-06-26T07:30:08Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ sp.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements.&lt;br /&gt;
| The HTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hyphen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt;&lt;br /&gt;
* In XHTML, empty elements may use either the empty element syntax (&amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;) or have an end tag immediately follow the start tag (&amp;lt;code&amp;gt;&amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/br&amp;amp;gt;&amp;lt;/code&amp;gt;). In HTML, the empty element syntax (trailing slash) is allowed on void elements, but forbidden on other elements. However, it serves no purpose whatsoever and can be omitted. End tags for void elements are forbidden.&lt;br /&gt;
** &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase.&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4970</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4970"/>
		<updated>2010-06-26T07:27:51Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ comment &amp;amp; proc. inst guidance&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements.&lt;br /&gt;
| The HTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; (bogus comments such as those beginning with &amp;quot;&amp;lt;?&amp;quot; are deprecated).  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hypen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
| Only use comments of the &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--...--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; variety. Do not use two consecutive U+002D HYPHEN-MINUS (-) characters in comment content or end with such a hyphen (especially for the sake of XML). &#039;&#039;&#039;Do not begin comments with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely). Processing instructions might need to be avoided entirely in case HTML may in future disallow them completely.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt;&lt;br /&gt;
* In XHTML, empty elements may use either the empty element syntax (&amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;) or have an end tag immediately follow the start tag (&amp;lt;code&amp;gt;&amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/br&amp;amp;gt;&amp;lt;/code&amp;gt;). In HTML, the empty element syntax (trailing slash) is allowed on void elements, but forbidden on other elements. However, it serves no purpose whatsoever and can be omitted. End tags for void elements are forbidden.&lt;br /&gt;
** &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase.&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4969</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4969"/>
		<updated>2010-06-26T07:18:02Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ namespaces&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced elements&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm. Elements in the HTML, SVG, or MathML namespaces may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute explicitly specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the xmlns attribute itself ends up in no namespace. Foreign elements are also not treated as being in another namespace and will have no effect except for displaying by default as inline elements.&lt;br /&gt;
| The HTML namespace must be declared for HTML elements according to the rules defined by the &#039;&#039;[http://www.w3.org/TR/REC-xml-names/ Namespaces in XML]&#039;&#039; specification.  Namespaces must be explicitly declared. The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute ends up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace. Foreign elements can be used independently of HTML elements, as long as they are assigned to their own namespace.&lt;br /&gt;
|&lt;br /&gt;
| Declare HTML namespaces (or other namespaces) explicitly. &#039;&#039;&#039;Do not depend on the behavior of foreign namespaced elements in an HTML setting; if you need to include these, you will probably wish to set this foreign markup via CSS to &amp;lt;code&amp;gt;display:none&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaced attributes on HTML elements&lt;br /&gt;
| Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements. &lt;br /&gt;
| The &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Do not use namespaced attributes on HTML elements. Do not depend on the behavior of foreign attributes in an HTML setting.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot;.  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hypen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt;&lt;br /&gt;
* In XHTML, empty elements may use either the empty element syntax (&amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;) or have an end tag immediately follow the start tag (&amp;lt;code&amp;gt;&amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/br&amp;amp;gt;&amp;lt;/code&amp;gt;). In HTML, the empty element syntax (trailing slash) is allowed on void elements, but forbidden on other elements. However, it serves no purpose whatsoever and can be omitted. End tags for void elements are forbidden.&lt;br /&gt;
** &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase.&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4968</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4968"/>
		<updated>2010-06-26T07:05:33Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Markup */ rmv now included section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaces&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm.&lt;br /&gt;
|The rules defined in the [http://www.w3.org/TR/REC-xml-names/ Namespaces in XML] specification apply.  Namespaces must be explicitly declared.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on HTML elements&lt;br /&gt;
|Elements in the HTML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the attribute ends up in no namespace.&lt;br /&gt;
&lt;br /&gt;
Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements.&lt;br /&gt;
|The HTML namespace must be declared for HTML elements according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot;.  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hypen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt;&lt;br /&gt;
* In XHTML, empty elements may use either the empty element syntax (&amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;) or have an end tag immediately follow the start tag (&amp;lt;code&amp;gt;&amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/br&amp;amp;gt;&amp;lt;/code&amp;gt;). In HTML, the empty element syntax (trailing slash) is allowed on void elements, but forbidden on other elements. However, it serves no purpose whatsoever and can be omitted. End tags for void elements are forbidden.&lt;br /&gt;
** &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase.&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4967</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4967"/>
		<updated>2010-06-26T07:05:27Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ +namespace and further encoding info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8 (and included in the first 512 bytes of the document), in which case it is probably a good idea to include it for the sake of HTML (as &amp;lt;nowiki&amp;gt;&amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;) in case you cannot specify such in a content header.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaces&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm.&lt;br /&gt;
|The rules defined in the [http://www.w3.org/TR/REC-xml-names/ Namespaces in XML] specification apply.  Namespaces must be explicitly declared.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on HTML elements&lt;br /&gt;
|Elements in the HTML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; (see [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration]).  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the attribute ends up in no namespace.&lt;br /&gt;
&lt;br /&gt;
Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements.&lt;br /&gt;
|The HTML namespace must be declared for HTML elements according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot;.  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hypen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt;&lt;br /&gt;
* In XHTML, empty elements may use either the empty element syntax (&amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;) or have an end tag immediately follow the start tag (&amp;lt;code&amp;gt;&amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/br&amp;amp;gt;&amp;lt;/code&amp;gt;). In HTML, the empty element syntax (trailing slash) is allowed on void elements, but forbidden on other elements. However, it serves no purpose whatsoever and can be omitted. End tags for void elements are forbidden.&lt;br /&gt;
** &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Markup ===&lt;br /&gt;
&lt;br /&gt;
(Need to move these into the above table)&lt;br /&gt;
&lt;br /&gt;
* The [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration] (&amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute) is required in XHTML.  The xmlns attribute is also allowed to appear on any element in HTML on the condition that is has the value &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
** &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
** In HTML, the xmlns attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier.  When parsed by an HTML parser, the attribute ends up in the null namespace&lt;br /&gt;
** In XML (with an [http://www.w3.org/TR/xml-names/ XML Namespaces]-aware parser), an xmlns attribute is part of the namespace declaration mechanism, and an element cannot actually have an xmlns attribute in the null namespace.  In DOM implementations, the attribute ends up in the &amp;quot;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://www.w3.org/2000/xmlns/&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; namespace.&lt;br /&gt;
* XHTML allows non XHTML elements and attributes (in different namespaces) to be used, HTML does not.&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase.&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4966</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4966"/>
		<updated>2010-06-26T06:53:35Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Overlap Language */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents. Guidelines are listed below for how one can construct such a polyglot document which will work in either environment. Besides following the well-formedness rules of XML, there are some other restrictions to which one must adhere (for the sake of text/html documents).&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8, in which case it is probably a good idea to include it for the sake of HTML.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaces&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm.&lt;br /&gt;
|The rules defined in the [http://www.w3.org/TR/REC-xml-names/ Namespaces in XML] specification apply.  Namespaces must be explicitly declared.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on HTML elements&lt;br /&gt;
|Elements in the HTML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt;.  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the attribute ends up in no namespace.&lt;br /&gt;
&lt;br /&gt;
Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements.&lt;br /&gt;
|The HTML namespace must be declared for HTML elements according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot;.  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hypen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt;&lt;br /&gt;
* In XHTML, empty elements may use either the empty element syntax (&amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;) or have an end tag immediately follow the start tag (&amp;lt;code&amp;gt;&amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/br&amp;amp;gt;&amp;lt;/code&amp;gt;). In HTML, the empty element syntax (trailing slash) is allowed on void elements, but forbidden on other elements. However, it serves no purpose whatsoever and can be omitted. End tags for void elements are forbidden.&lt;br /&gt;
** &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Markup ===&lt;br /&gt;
&lt;br /&gt;
(Need to move these into the above table)&lt;br /&gt;
&lt;br /&gt;
* The [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration] (&amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute) is required in XHTML.  The xmlns attribute is also allowed to appear on any element in HTML on the condition that is has the value &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
** &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
** In HTML, the xmlns attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier.  When parsed by an HTML parser, the attribute ends up in the null namespace&lt;br /&gt;
** In XML (with an [http://www.w3.org/TR/xml-names/ XML Namespaces]-aware parser), an xmlns attribute is part of the namespace declaration mechanism, and an element cannot actually have an xmlns attribute in the null namespace.  In DOM implementations, the attribute ends up in the &amp;quot;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://www.w3.org/2000/xmlns/&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; namespace.&lt;br /&gt;
* XHTML allows non XHTML elements and attributes (in different namespaces) to be used, HTML does not.&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase.&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4965</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4965"/>
		<updated>2010-06-26T06:49:03Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Character Encoding */ remove now already included section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents.&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8, in which case it is probably a good idea to include it for the sake of HTML.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaces&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm.&lt;br /&gt;
|The rules defined in the [http://www.w3.org/TR/REC-xml-names/ Namespaces in XML] specification apply.  Namespaces must be explicitly declared.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on HTML elements&lt;br /&gt;
|Elements in the HTML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt;.  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the attribute ends up in no namespace.&lt;br /&gt;
&lt;br /&gt;
Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements.&lt;br /&gt;
|The HTML namespace must be declared for HTML elements according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot;.  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hypen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt;&lt;br /&gt;
* In XHTML, empty elements may use either the empty element syntax (&amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;) or have an end tag immediately follow the start tag (&amp;lt;code&amp;gt;&amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/br&amp;amp;gt;&amp;lt;/code&amp;gt;). In HTML, the empty element syntax (trailing slash) is allowed on void elements, but forbidden on other elements. However, it serves no purpose whatsoever and can be omitted. End tags for void elements are forbidden.&lt;br /&gt;
** &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Markup ===&lt;br /&gt;
&lt;br /&gt;
(Need to move these into the above table)&lt;br /&gt;
&lt;br /&gt;
* The [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration] (&amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute) is required in XHTML.  The xmlns attribute is also allowed to appear on any element in HTML on the condition that is has the value &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
** &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
** In HTML, the xmlns attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier.  When parsed by an HTML parser, the attribute ends up in the null namespace&lt;br /&gt;
** In XML (with an [http://www.w3.org/TR/xml-names/ XML Namespaces]-aware parser), an xmlns attribute is part of the namespace declaration mechanism, and an element cannot actually have an xmlns attribute in the null namespace.  In DOM implementations, the attribute ends up in the &amp;quot;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://www.w3.org/2000/xmlns/&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; namespace.&lt;br /&gt;
* XHTML allows non XHTML elements and attributes (in different namespaces) to be used, HTML does not.&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase.&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4964</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4964"/>
		<updated>2010-06-26T06:48:27Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ move to correct section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents.&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8, in which case it is probably a good idea to include it for the sake of HTML.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaces&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm.&lt;br /&gt;
|The rules defined in the [http://www.w3.org/TR/REC-xml-names/ Namespaces in XML] specification apply.  Namespaces must be explicitly declared.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on HTML elements&lt;br /&gt;
|Elements in the HTML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt;.  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the attribute ends up in no namespace.&lt;br /&gt;
&lt;br /&gt;
Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements.&lt;br /&gt;
|The HTML namespace must be declared for HTML elements according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot;.  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hypen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt;&lt;br /&gt;
* In XHTML, empty elements may use either the empty element syntax (&amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;) or have an end tag immediately follow the start tag (&amp;lt;code&amp;gt;&amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/br&amp;amp;gt;&amp;lt;/code&amp;gt;). In HTML, the empty element syntax (trailing slash) is allowed on void elements, but forbidden on other elements. However, it serves no purpose whatsoever and can be omitted. End tags for void elements are forbidden.&lt;br /&gt;
** &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Markup ===&lt;br /&gt;
&lt;br /&gt;
(Need to move these into the above table)&lt;br /&gt;
&lt;br /&gt;
* The [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration] (&amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute) is required in XHTML.  The xmlns attribute is also allowed to appear on any element in HTML on the condition that is has the value &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
** &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
** In HTML, the xmlns attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier.  When parsed by an HTML parser, the attribute ends up in the null namespace&lt;br /&gt;
** In XML (with an [http://www.w3.org/TR/xml-names/ XML Namespaces]-aware parser), an xmlns attribute is part of the namespace declaration mechanism, and an element cannot actually have an xmlns attribute in the null namespace.  In DOM implementations, the attribute ends up in the &amp;quot;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://www.w3.org/2000/xmlns/&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; namespace.&lt;br /&gt;
* XHTML allows non XHTML elements and attributes (in different namespaces) to be used, HTML does not.&lt;br /&gt;
&lt;br /&gt;
=== Character Encoding ===&lt;br /&gt;
&lt;br /&gt;
* In XHTML, the XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding]. In HTML, the XML declaration is forbidden&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead. It is forbidden in XHTML unless it specifies &#039;UTF-8&#039; (case insensitively) and is ignored if included.&lt;br /&gt;
* The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;. If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase.&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4963</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4963"/>
		<updated>2010-06-26T06:47:42Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ remove list bullet&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents.&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;. If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8, in which case it is probably a good idea to include it for the sake of HTML.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaces&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm.&lt;br /&gt;
|The rules defined in the [http://www.w3.org/TR/REC-xml-names/ Namespaces in XML] specification apply.  Namespaces must be explicitly declared.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on HTML elements&lt;br /&gt;
|Elements in the HTML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt;.  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the attribute ends up in no namespace.&lt;br /&gt;
&lt;br /&gt;
Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements.&lt;br /&gt;
|The HTML namespace must be declared for HTML elements according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot;.  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hypen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt;&lt;br /&gt;
* In XHTML, empty elements may use either the empty element syntax (&amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;) or have an end tag immediately follow the start tag (&amp;lt;code&amp;gt;&amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/br&amp;amp;gt;&amp;lt;/code&amp;gt;). In HTML, the empty element syntax (trailing slash) is allowed on void elements, but forbidden on other elements. However, it serves no purpose whatsoever and can be omitted. End tags for void elements are forbidden.&lt;br /&gt;
** &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Markup ===&lt;br /&gt;
&lt;br /&gt;
(Need to move these into the above table)&lt;br /&gt;
&lt;br /&gt;
* The [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration] (&amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute) is required in XHTML.  The xmlns attribute is also allowed to appear on any element in HTML on the condition that is has the value &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
** &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
** In HTML, the xmlns attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier.  When parsed by an HTML parser, the attribute ends up in the null namespace&lt;br /&gt;
** In XML (with an [http://www.w3.org/TR/xml-names/ XML Namespaces]-aware parser), an xmlns attribute is part of the namespace declaration mechanism, and an element cannot actually have an xmlns attribute in the null namespace.  In DOM implementations, the attribute ends up in the &amp;quot;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://www.w3.org/2000/xmlns/&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; namespace.&lt;br /&gt;
* XHTML allows non XHTML elements and attributes (in different namespaces) to be used, HTML does not.&lt;br /&gt;
&lt;br /&gt;
=== Character Encoding ===&lt;br /&gt;
&lt;br /&gt;
* In XHTML, the XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding]. In HTML, the XML declaration is forbidden&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead. It is forbidden in XHTML unless it specifies &#039;UTF-8&#039; (case insensitively) and is ignored if included.&lt;br /&gt;
* The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;. If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase.&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4962</id>
		<title>HTML vs. XHTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=HTML_vs._XHTML&amp;diff=4962"/>
		<updated>2010-06-26T06:47:00Z</updated>

		<summary type="html">&lt;p&gt;Brettz9: /* Syntax and Parsing */ encoding&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Differences Between HTML and XHTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFEEEE; padding: .5em 1em;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;This page is currently being revised. Some information is incomplete or missing.&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;border: 1px dashed lightgray; background-color: #FFF8E4; padding: .5em 1em;&amp;quot;&amp;gt;Please note that the information in here is based upon the current spec for (X)HTML5.  Some of the issues technically do not apply to previous versions of HTML.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although HTML and XHTML appear to have similarities in their syntax, they are significantly different in many ways.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Note&#039;&#039;&#039;: As the current WHATWG document is a draft, this section will need to track to a moving target.&lt;br /&gt;
&lt;br /&gt;
=== Overlap Language ===&lt;br /&gt;
&lt;br /&gt;
There is a community who find it valuable to be able to serve HTML5 documents which are also valid XML documents. They may, for example, use XML tools to generate the document, and they and others may process the document using XML tools.  These documents are served as text/html.&lt;br /&gt;
&lt;br /&gt;
This language is sometimes called &amp;quot;polyglot&amp;quot;.  It is the overlap language of documents which are both HTML5 documents and XML documents.&lt;br /&gt;
&lt;br /&gt;
This wiki web page is an example of such a document.  You can parse it with an XML parser or an HTML parser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== MIME Types ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  Mime Type&lt;br /&gt;
|  Must use &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  Must use an XML MIME type, such as &amp;lt;code&amp;gt;application/xml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;application/xhtml+xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
|  It is the MIME type that determines what type of document you are using.  Any document, including a document authored with the intention of being XHTML, served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt; is technically an HTML document.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but HTML 5 now defines that such documents are HTML, not XHTML.&lt;br /&gt;
&lt;br /&gt;
=== Syntax and Parsing ===&lt;br /&gt;
&lt;br /&gt;
XHTML uses XML parsing requirements. HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.  The following table describes the differences between how each is parsed.&lt;br /&gt;
&lt;br /&gt;
The column on &amp;quot;Guidance for XHTML-HTML compatibility&amp;quot; lists ways in which a document can be crafted to work in either XHTML or HTML. The item will be bolded if it is a requirement for XHTML-compliant code to be changed, since XHTML will otherwise usually work as HTML, at least if its full features are constrained.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  HTML Requirement&lt;br /&gt;
!  XHTML Requirement&lt;br /&gt;
!  Notes&lt;br /&gt;
! Guidance for XHTML-HTML compatibility&lt;br /&gt;
|-&lt;br /&gt;
!Parsing Modes&lt;br /&gt;
|Three parsing modes are defined: &#039;&#039;no quirks mode&#039;&#039;, &#039;&#039;quirks mode&#039;&#039; and &#039;&#039;limited quirks mode&#039;&#039;.  The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string.  &lt;br /&gt;
|XML parsing rules are used.  There is only one mode.&lt;br /&gt;
|The parsing modes in HTML also have an effect upon script and stylesheet processing. XHTML is considered to be in &#039;&#039;no quirks mode&#039;&#039; for these purposes.&lt;br /&gt;
|-&lt;br /&gt;
!Error Handling&lt;br /&gt;
|HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.&lt;br /&gt;
|Well-formedness errors are fatal&lt;br /&gt;
|  &lt;br /&gt;
| Ensure there are no well-formedness errors.&lt;br /&gt;
|-&lt;br /&gt;
! Character Encoding (including XML Declaration, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;)&lt;br /&gt;
| The XML declaration is forbidden (treated as a bogus comment, but such style of comments are deprecated), but the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead.&lt;br /&gt;
| The XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding], while &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; is only allowed as case-insensitive &amp;quot;UTF-8&amp;quot; (and is ignored if included).&lt;br /&gt;
* The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;. If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;If you need to include XML 1.1-only markup, if you do not wish to convert the encoding of the document to UTF-8 or UTF-16 (since use of other encodings also requires a declaration), or if you wish to define an external SYSTEM DTD in the DOCTYPE but use standalone=yes (redundant?), you must use an XML Declaration for XHTML, but this may not be allowable in the future in HTML. For future compatibility, it would be best to avoid XML 1.1-only markup, convert to UTF-8 or UTF-16 (probably UTF-8 which could allow use of a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag), and avoid use of a SYSTEM DTD (rendering the standalone=yes unnecessary), respectively. Do not use a &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; tag, unless it is UTF-8, in which case it is probably a good idea to include it for the sake of HTML.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Namespaces&lt;br /&gt;
|Elements and attributes for known vocabularies (HTML, SVG and MathML) are implicitly assigned to appropriate namespaces, according to the rules specified in the parsing algorithm.&lt;br /&gt;
|The rules defined in the [http://www.w3.org/TR/REC-xml-names/ Namespaces in XML] specification apply.  Namespaces must be explicitly declared.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on HTML elements&lt;br /&gt;
|Elements in the HTML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt;.  The attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the attribute ends up in no namespace.&lt;br /&gt;
&lt;br /&gt;
Attributes of the form &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; may not be used on HTML elements.&lt;br /&gt;
|The HTML namespace must be declared for HTML elements according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Namespace attributes on foreign elements&lt;br /&gt;
|&lt;br /&gt;
Elements in the SVG namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Elements in the MathML namespace may have an &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;lt;/code&amp;gt;.  The attribute is optional because the namespace is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
Foreign elements may also have an &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attribute specified, if, and only if, it has the exact value &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  This attribute is optional, even if XLink attributes are used, because the namespaces for XLink attributes is implied during parsing.&lt;br /&gt;
&lt;br /&gt;
When parsed by an HTML parser, the &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:xlink&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|The SVG and MathML namespaces must be declared for SVG and MathML elements, respectively, according to the rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The &amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlns:&amp;lt;var&amp;gt;prefix&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; attributes end up in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/2000/xmlns&amp;quot;&amp;lt;/code&amp;gt; namespace.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XLink attributes&lt;br /&gt;
|Foreign elements may use the attributes &amp;lt;code&amp;gt;xlink:actuate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:arcrole&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:href&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:role&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:show&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xlink:title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xlink:type&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xlink&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|XLink attributes may be specified on foreign elements using any prefix, subject to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039;.  The XLink namespace must be declared according to the conformance rules defined by &#039;&#039;Namespaces in XML&#039;&#039; if XLink attributes are used within the document.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!XML attributes&lt;br /&gt;
|&lt;br /&gt;
Foreign elements may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
HTML elements may use the &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt; attribute. The attribute in no namespace with no prefix and with the literal localname &amp;quot;&amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;&amp;quot; has no effect on language processing (as does &amp;quot;&amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt;&amp;quot;.  HTML elements must not use the &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
| Any element, including HTML elements, may use the attributes &amp;lt;code&amp;gt;xml:lang&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt;.  These attributes are placed in the &amp;lt;code&amp;gt;&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;&amp;lt;/code&amp;gt;.  The prefix used must be &amp;quot;&amp;lt;code&amp;gt;xml&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Though they can be used on foreign elements, do not use &amp;lt;code&amp;gt;xml:base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xml:id&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;xml:space&amp;lt;/code&amp;gt; on HTML elements; use both xml:lang and lang attributes whenever one is to be needed on HTML elements.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Attributes&lt;br /&gt;
| Names are not case sensitive. Attribute minimization is allowed (i.e. omitting the equals sign and the value)&lt;br /&gt;
| Names are case sensitive (and lower case). Attribute minimization is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Use lower case attribute names. Do not minimize attributes.&lt;br /&gt;
|-&lt;br /&gt;
!Attribute values&lt;br /&gt;
| White space characters are not normalized. Unquoted attribute values are allowed. Fixed or default attribute values ...?&lt;br /&gt;
| White space characters are [http://www.w3.org/TR/REC-xml/#AVNormalize normalized] to single spaces (unless attribute is of CDATA type?). Unquoted attribute values are not allowed. Default attribute values could conceivably be defined with a DTD.&lt;br /&gt;
|&lt;br /&gt;
| Create whitespace in attribute values which is already normalized (converted to single spaces). Always quote attribute values. &#039;&#039;&#039;Do not rely on defining default or fixed attribute values in a DTD (unless it matches HTML behavior).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Space characters&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000C FORM FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The space characters are defined as:&lt;br /&gt;
* U+0009 CHARACTER TABULATION&lt;br /&gt;
* U+000A LINE FEED&lt;br /&gt;
* U+000D CARRIAGE RETURN&lt;br /&gt;
* U+0020 SPACE&lt;br /&gt;
|The difference is the inclusion of Form Feed. Form feed characters are discouraged in XML 1.1.&lt;br /&gt;
| Do not use the form feed character.&lt;br /&gt;
|-&lt;br /&gt;
!  The DOCTYPE&lt;br /&gt;
|&lt;br /&gt;
A DOCTYPE is a mostly useless, but required, header. The DOCTYPE is used during parsing to determing the parsing mode.  The keywords &amp;quot;&amp;lt;code&amp;gt;DOCTYPE&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;PUBLIC&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&amp;quot;, and the name &amp;quot;&amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt;&amp;quot; are treated case insensitively.  The system identifier &amp;lt;code&amp;gt;&amp;quot;about:legacy-compat&amp;quot;&amp;lt;/code&amp;gt; (and the public and system identifiers for previous versions of HTML) are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Conforming HTML documents are required to use &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/code&amp;gt; (case insensitively) or the legacy-compat version &amp;lt;code&amp;gt;&amp;amp;lt;!DOCTYPE html SYSTEM &amp;quot;about:legacy-compat&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When using the obsolete but conforming DOCTYPEs based on the HTML 4.0 and 4.01 Strict DTDs, the system identifier is optional.  The obsolete but conforming DOCTYPEs based on XHTML 1.0 Strict and XHTML 1.1 may also be specified.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is forbidden.  The system identifier is never de-referenced by HTML implementations.&lt;br /&gt;
|&lt;br /&gt;
The DOCTYPE is optional.  XML rules for case sensitivity apply (everything is case sensitive).&lt;br /&gt;
&lt;br /&gt;
Either of the DOCTYPEs defined in HTML5 may be used, or any other custom DOCTYPE.  If the public identifier is specified, the system identifier must also be specified.  The obsolete status of the &#039;&#039;obsolete permitted DOCTYPEs&#039;&#039; defined for HTML does not apply to XHTML.  Any DOCTYPE may be used, subject to the conformance rules defined by XML.&lt;br /&gt;
&lt;br /&gt;
Use of an internal subset is permitted according to the requirements of XML.  Some validating XML processors may dereference the system identifier, if used, but most browsers use non-validating processors.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;Use the empty DOCTYPE with no SYSTEM or PUBLIC identifiers and no use of internet subset.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Element names&lt;br /&gt;
| Element names are case insensitive.&lt;br /&gt;
| Element names are case sensitive and lower-case.&lt;br /&gt;
| &lt;br /&gt;
| Only use lower-case element names (as with attributes).&lt;br /&gt;
|-&lt;br /&gt;
!  Void vs. Non-void Elements&lt;br /&gt;
|  Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content.  A trailing slash may optionally be inserted at the end of the element&#039;s tag, immediately before the closing greater-than sign. For non-void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), the trailing slash is a parsing error (ignored and thus treated as unclosed).&lt;br /&gt;
|  Void elements may use either the empty-element tag syntax (&#039;&#039;EmptyElemTag&#039;&#039;) or use a start tag immediately followed by an end tag, with no content in between.  While it is possible for the element to contain content, this is non-conforming.&lt;br /&gt;
|&lt;br /&gt;
| &#039;&#039;&#039;For void elements (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;), do not include content or use a closing tag; only use a self-closing element with closing slash at the end (with a space preceding it for the sake of older browsers). For non-void elements, i.e., where content can exist (e.g., &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/nowiki&amp;gt;), always use an explicit closing tag (not a self-closing tag) even if there is no content.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! Unexpected end tags&lt;br /&gt;
| Unexpected end tags (in HTML, an unexpected &amp;lt;code&amp;gt;&amp;amp;lt;/br&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;/p&amp;gt;&amp;lt;/code&amp;gt; can cause the start tag to be implied before it).&lt;br /&gt;
| Unexpected end tags are well-formedness errors.&lt;br /&gt;
|&lt;br /&gt;
| Do not add end tags unless there is an explicit and properly nested open tag before it.&lt;br /&gt;
|-&lt;br /&gt;
! End tag with attributes&lt;br /&gt;
| ?&lt;br /&gt;
| An end tag with attributes is not allowed.&lt;br /&gt;
|&lt;br /&gt;
| Do not use end tags with attributes.&lt;br /&gt;
|-&lt;br /&gt;
!  Raw text elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  RCDATA elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Foreign elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Normal elements&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  Optional tags&lt;br /&gt;
|&lt;br /&gt;
For [[#HTML_Elements_with_Optional_Tags|some elements]], the start and/or end tags are optional and are implied by certain specified conditions.  For example, the end tag for the &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element is implied by a subsequent &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
Omitting the end tag for other elements is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  End tags must be explicitly included for all elements, except empty elements using the &#039;&#039;EmptyElemTag&#039;&#039; syntax.&lt;br /&gt;
|  &lt;br /&gt;
| Always use end tags (or self-closing tags for void elements).&lt;br /&gt;
|-&lt;br /&gt;
!  Comment syntax&lt;br /&gt;
|  Comments must start with the four character sequence &amp;quot;&amp;lt;code&amp;gt;&amp;amp;lt;!--&amp;lt;/code&amp;gt;&amp;quot; and must be ended by the three character sequence &amp;quot;&amp;lt;code&amp;gt;--&amp;gt;&amp;lt;/code&amp;gt;&amp;quot;.  The content of comments must not start with a single U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN (&#039;&amp;gt;&#039;) character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character.  Violating these constraints is a parse error and various error recovery procedures are applied appropriately.&lt;br /&gt;
|  The content of comments must not contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a hypen. Violating this is a well-formedness error.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
!Processing Instructions&lt;br /&gt;
| HTML does not allow processing instructions and deprecates the bogus comments which appear in their form, whether in the form &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...&amp;amp;gt;&amp;lt;/code&amp;gt; (without a closing &#039;?&#039;) or &amp;lt;code&amp;gt;&amp;amp;lt;?foo ...?&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
| XHTML allows the use of XML processing instructions which are only closed by &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
| &lt;br /&gt;
| &#039;&#039;&#039;Avoid &amp;quot;&amp;gt;&amp;quot; inside processing instructions (as these will close the &amp;quot;instruction&amp;quot; (comment) prematurely) (or one must strip out processing instructions entirely).&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!CDATA sections&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a a bogus comment. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is just regular character data.&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;![CDATA[...]]&amp;amp;gt;&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section. The sequence of characters &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content when it does not mark the end of a &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; section is a well-formedness error.&lt;br /&gt;
|&lt;br /&gt;
| Ensure sequence &amp;amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;amp;quot; in content is escaped (not necessary to escape in attribute values). &#039;&#039;&#039;Do not use CDATA sections.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!  Unescaped Special Characters &lt;br /&gt;
|&lt;br /&gt;
Unescaped ampersands (U+0026 AMPERSAND - &amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;) are permitted within the content of &#039;&#039;normal elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039;, &#039;&#039;foreign elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039; where they are not considered to be &#039;&#039;ambiguous ampersands&#039;&#039;, and within &#039;&#039;Raw text elements&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unescaped less than signs (U+003C LESS-THAN SIGN - &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;, instead of &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;) are permitted in &#039;&#039;Raw text elements&#039;&#039;, &#039;&#039;RCDATA elements&#039;&#039; and &#039;&#039;attribute values&#039;&#039;, excluding the &#039;&#039;unquoted attribute value syntax&#039;&#039;.&lt;br /&gt;
|  Unescaped ampersands and less-than signs may not appear within &#039;&#039;CharData&#039;&#039; or &#039;&#039;AttValue&#039;&#039; (basically, the normal text content of elements and attribute values.)  Violation of this constraint is a well-formedness error.&lt;br /&gt;
|  &lt;br /&gt;
| Always escape ampersands and less-than signs in text content and attribute values. See CDATA for need to escape sequence &amp;quot;&amp;lt;code&amp;gt;]]&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot; in text content.&lt;br /&gt;
|-&lt;br /&gt;
!Character References&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Entity References&lt;br /&gt;
| In HTML, all entity references are predefined and do not require a DTD.&lt;br /&gt;
| There is no formal DTD for XHTML5, but one could provide an exteranl DTD (if not an internal subset?) for use with one&#039;s entity-checking (or validating) parser, but be aware that browsers do not universally use external entity-checking (or validating) parsers and may not read the external DTD. (Some still have bugs in that they mistakenly create a well-formedness error out of such missing entities instead of showing them as missing, making them clickable, or using a entity-checking or validating parser.)&lt;br /&gt;
|&lt;br /&gt;
| Do not use entity references in XHTML (except for the 5 predefined entities: &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;lt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;amp;apos;)&amp;lt;/code&amp;gt;; use the equivalent Unicode or numeric character reference sequence instead.&lt;br /&gt;
|-&lt;br /&gt;
! Character data&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| The valid set of unicode characters in XML 1.0 is limited beyond that in HTML (we need to specify this here).&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Element-specific parsing====&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. (Note: the definition of &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; differs from that in XML). In XML, they&#039;re parsed as normal elements (which means that things that look like comments are treated as &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; comments, and things that look like start tags actually are start tags).&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; elements. (Note: The definition of &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; differs from that in SGML and there is no &amp;lt;code&amp;gt;RCDATA&amp;lt;/code&amp;gt; in XML).&lt;br /&gt;
* In HTML, if scripting is enabled, the &amp;lt;code&amp;gt;noscript&amp;lt;/code&amp;gt; element is parsed as an &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; element. If scripting is disabled, it&#039;s parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can&#039;t really be used to stop content from being present when script is disabled.&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;iframe&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;noembed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noframes&amp;lt;/code&amp;gt; elements are parsed as &amp;lt;code&amp;gt;CDATA&amp;lt;/code&amp;gt; elements. In XHTML, they are parsed as normal elements, and therefore do not stop content from being used.&lt;br /&gt;
* In HTML, elements with optional tags are implied in certain conditions.&lt;br /&gt;
* In HTML, tags for certain elements, which appear out of context, are ignored. This includes &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;colgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;frameset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;optgroup&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tbody&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tfoot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thead&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt;.&lt;br /&gt;
* In XHTML, &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; elements may contain child &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; elements. In the HTML serialisation, due to backwards compatibility constraints, this is not possible (though it may be done through DOM manipulation).&lt;br /&gt;
* The &amp;lt;code&amp;gt;plaintext&amp;lt;/code&amp;gt; element has a special parsing requirement in HTML. (It is, however, forbidden.)&lt;br /&gt;
* In HTML, a line feed that immediately follows a &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;listing&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; start tag is ignored.&lt;br /&gt;
* &amp;lt;em&amp;gt;Many other special handling of edge cases and error conditions, not all of which are listed here, occur in HTML.&amp;lt;/em&amp;gt;&lt;br /&gt;
* In XHTML, empty elements may use either the empty element syntax (&amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;) or have an end tag immediately follow the start tag (&amp;lt;code&amp;gt;&amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/br&amp;amp;gt;&amp;lt;/code&amp;gt;). In HTML, the empty element syntax (trailing slash) is allowed on void elements, but forbidden on other elements. However, it serves no purpose whatsoever and can be omitted. End tags for void elements are forbidden.&lt;br /&gt;
** &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;br&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;img&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;embed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;area&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;col&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTML Elements with Optional Tags ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Element&lt;br /&gt;
! Start Tag&lt;br /&gt;
! End Tag&lt;br /&gt;
|-&lt;br /&gt;
!html&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!head&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!body&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!li&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!dt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!p&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!colgroup&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!thead&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tbody&lt;br /&gt;
|optional&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tfoot&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!tr&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!th&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!td&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rt&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!rp&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!optgroup&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|-&lt;br /&gt;
!option&lt;br /&gt;
|required&lt;br /&gt;
|optional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Markup ===&lt;br /&gt;
&lt;br /&gt;
(Need to move these into the above table)&lt;br /&gt;
&lt;br /&gt;
* The [http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F namespace declaration] (&amp;lt;code&amp;gt;xmlns&amp;lt;/code&amp;gt; attribute) is required in XHTML.  The xmlns attribute is also allowed to appear on any element in HTML on the condition that is has the value &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
** &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
** In HTML, the xmlns attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier.  When parsed by an HTML parser, the attribute ends up in the null namespace&lt;br /&gt;
** In XML (with an [http://www.w3.org/TR/xml-names/ XML Namespaces]-aware parser), an xmlns attribute is part of the namespace declaration mechanism, and an element cannot actually have an xmlns attribute in the null namespace.  In DOM implementations, the attribute ends up in the &amp;quot;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://www.w3.org/2000/xmlns/&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;quot; namespace.&lt;br /&gt;
* XHTML allows non XHTML elements and attributes (in different namespaces) to be used, HTML does not.&lt;br /&gt;
&lt;br /&gt;
=== Character Encoding ===&lt;br /&gt;
&lt;br /&gt;
* In XHTML, the XML declaration may be used to [http://wiki.whatwg.org/wiki/FAQ#How_do_I_specify_the_character_encoding.3F specify the character encoding]. In HTML, the XML declaration is forbidden&lt;br /&gt;
* In HTML, the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; element with a &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute may be used instead. It is forbidden in XHTML unless it specifies &#039;UTF-8&#039; (case insensitively) and is ignored if included.&lt;br /&gt;
* The default character encoding for XHTML is, according to XML rules, &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF-16&amp;lt;/code&amp;gt;. If the encoding is unspecified in HTML, it should be determined through implementation specific heuristics or fallback to a default value (Note: this section of the spec is not yet finished).&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;document.write()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;document.writeln()&amp;lt;/code&amp;gt; cannot be used in XHTML, they can in HTML. &lt;br /&gt;
* In XHTML, the use of the &amp;lt;code&amp;gt;innerHTML&amp;lt;/code&amp;gt; property requires that the string be a well-formed fragment of XML. &lt;br /&gt;
* DOM APIs are case sensitive in XHTML and some are case insensitive in HTML.  (This does not apply to elements which are not in the HTML namespace)&lt;br /&gt;
** Element.tagName and Node.nodeName return the value in uppercase.&lt;br /&gt;
** Document.createElement() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Element.setAttributeNode() will change the attribute name to lowercase.&lt;br /&gt;
** Element.setAttribute() is case insensitive (the canonical form is lowercase).&lt;br /&gt;
** Document.getElementsByTagName() and Element.getElementsByTagName() are case insensitive.&lt;br /&gt;
** Document.renameNode(). If the new namespace is the HTML namespace, then the new qualified name will be lowercased before the rename takes place.&lt;br /&gt;
* In HTML, Document.createElement() will create an element in the HTML namespace.  In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.&lt;br /&gt;
** In XHTML, browsers lack interoperability in this area.  In Firefox and Safari, the namespace is dependent upon the MIME type.  In Opera, it&#039;s dependent upon the root element.&lt;br /&gt;
* XPath expressions targeted at pre-HTML5 browsers need to use the XHTML namespace for XHTML and null for HTML. (HTML5 browsers would use the XHTML namespace even in HTML.)&lt;br /&gt;
&lt;br /&gt;
=== Stylesheets ===&lt;br /&gt;
&lt;br /&gt;
* Selectors, as used in CSS, match case sensitively in XHTML, but case insensitively in HTML.&lt;br /&gt;
* CSS requires special handling of the body element in HTML for painting backgrounds on the canvas, which do not apply to XHTML.&lt;br /&gt;
&lt;br /&gt;
== Differences Between HTML4 and HTML5 ==&lt;br /&gt;
&lt;br /&gt;
See [http://dev.w3.org/html5/html4-differences/ HTML5 differences from HTML4].&lt;br /&gt;
&lt;br /&gt;
== Differences Between DOM Level 2.0, 3.0 and the HTML 5 DOM APIs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This section might belong on a separate page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* TODO (need to talk about the changes to the DOM API that HTML5 is making, compared with DOM2 and DOM3)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* [http://meiert.com/de/publications/translations/whatwg.org/html-vs-xhtml/ German translation: &amp;quot;HTML 5 und XHTML 5 im Vergleich (WHATWG)&amp;quot;]&lt;br /&gt;
* [http://dancewithnet.com/2007/10/28/differences-between-html-and-xhtml/ Chinese translation: &amp;quot;HTML和XHTML的不同&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Brettz9</name></author>
	</entry>
</feed>