W3C home > Mailing lists > Public > public-html-commits@w3.org > April 2011

html5/html-xhtml-author-guide TEMPLATE.html,NONE,1.1

From: Eliot Graff via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 08 Apr 2011 21:01:23 +0000
To: public-html-commits@w3.org
Message-Id: <E1Q8Inz-0006xn-IB@lionel-hutz.w3.org>
Update of /sources/public/html5/html-xhtml-author-guide
In directory hutz:/tmp/cvs-serv26749

Added Files:
	TEMPLATE.html 
Log Message:
Template for polglot spec postproduction process

--- NEW FILE: TEMPLATE.html ---
<!DOCTYPE html>

<html dir="ltr" lang="en">
<head>
	<title>Polyglot Markup: HTML-Compatible XHTML Documents</title>
	<meta name="GENERATOR" content="MSHTML 8.00.7600.16588"/>
	<link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-ED"/>
	<link rel="stylesheet" type="text/css" href="http://dev.w3.org/2009/dap/ReSpec.js/css/respec.css"/>
</head>

<body style="display: inherit;">
	<div class="head">
		<p>
			<a href="http://www.w3.org/"><img height="48" width="72" alt="W3C" src="http://www.w3.org/Icons/w3c_home"/></a>
		</p>
		<h1 class="title" id="title">Polyglot Markup: HTML-Compatible XHTML Documents</h1>
		<h2 id="w3c-editor-s-draft-07-april-2011">W3C Editor's Draft 7 April 2011</h2>
		<dl>
			<dt>This version:</dt>
			<dd><a href="http://dev.w3.org/html5/html-xhtml-author-guide/">http://dev.w3.org/html5/html-xhtml-author-guide/</a></dd>
			
			<dt>Latest published version:</dt>
			<dd><a href="http://www.w3.org/TR/html-polyglot/">http://www.w3.org/TR/html-polyglot/</a></dd>
			
			<dt>Latest editor's draft:</dt>
			<dd><a href="http://dev.w3.org/html5/html-xhtml-author-guide/">http://dev.w3.org/html5/html-xhtml-author-guide/</a></dd>
			
			<dt>Previous versions:</dt>
			<dd><a href="http://www.w3.org/TR/2011/WD-html-polyglot-20110405/">http://www.w3.org/TR/2011/WD-html-polyglot-20110405/</a></dd>
			<dd><a href="http://www.w3.org/TR/2011/WD-html-polyglot-20110113/">http://www.w3.org/TR/2011/WD-html-polyglot-20110113/</a></dd>
			<dd><a href="http://www.w3.org/TR/2010/WD-html-polyglot-20100624/">http://www.w3.org/TR/2010/WD-html-polyglot-20100624/</a></dd>
			<dd><a href="http://www.w3.org/TR/2010/WD-html-polyglot-20101019/">http://www.w3.org/TR/2010/WD-html-polyglot-20101019/</a></dd>
			
			<dt>Editor:</dt>
			<dd><span>Eliot Graff</span>, Microsoft Corporation</dd>
		</dl>
		<p class="copyright">
			<a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> &#xA9; 2011 
			<a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>&#xAE;</sup> 
			(<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, 
			<a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, 
			<a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, 
			<a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and 
			<a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
		</p>
	</div>
	
	<hr/>

	<div class="introductory section" id="abstract">
		<h2>Abstract</h2>
			A document that uses polyglot markup is a document that is a stream of bytes that parses into identical document trees 
			(with the exception of the xmlns attribute on the root element) when processed as HTML and when processed as XML.
			Polyglot markup that meets a well defined set of constraints is interpreted as compatible, regardless of whether they are processed as HTML or as XHTML, per the HTML5 specification. 
			Polyglot markup uses a specific DOCTYPE, namespace declarations, and a specific case&#x2014;normally lower case but occasionally camel case&#x2014;for element and attribute names. 
			Polyglot markup uses lower case for certain attribute values. 
			Further constraints include those on empty elements, named entity references, and the use of scripts and style. 
<!--End of Abstract-->
	</div>
	
	<div id="sotd" class="introductory section">
		<h2>Status of This Document</h2>
		<p>
			<em>This section describes the status of this document at the time of its publication. 
			Other documents may supersede this document. 
			A list of current W3C publications and the latest revision of this technical report can be found in the 
			<a href="http://www.w3.org/TR/">W3C technical reports index</a> at http://www.w3.org/TR/.</em>
		</p>
		<p>
			This document summarizes design guidelines for authors who wish their XHTML or HTML documents to validate on either HTML or XML parsers, 
			assuming the parsers to be HTML5-compliant. This specification is intended to be used by web authors. 
			It is not a specification for user agents and creates no obligations on user agents. 
			Note that this recommendation does not define how HTML5-conforming user agents should process HTML documents. 
			Nor does it define the meaning of the Internet Media Type text/html. 
			For user agent guidance and for these definitions, see [<cite><a href="#bib-HTML5" rel="biblioentry" class="bibref">HTML5</a></cite>] and 
			[<cite><a href="#bib-RFC2854" rel="biblioentry" class="bibref">RFC2854</a></cite>]. 
		</p>
		<p>
			This document was published by the <a href="http://www.w3.org/html/wg/">HTML working group</a> as an Editor's Draft. 
			Please submit comments regarding this document by using the W3C's public bug database (<a href="http://www.w3.org/Bugs/Public/">
			http://www.w3.org/Bugs/Public/</a>) with the product set to <kbd>HTML WG</kbd> and the component set to 
			<kbd>HTML/XHTML Compatibility Authoring Guide (ed: Eliot Graff)</kbd>.
			If you cannot access the bug database, submit comments to <a href="mailto:public-html@w3.org@w3.org">public-html@w3.org@w3.org</a> 
			(<a href="mailto:public-html@w3.org-request@w3.org?subject=subscribe">subscribe</a>, 
			<a href="http://lists.w3.org/Archives/Public/public-html/">archives</a>) and arrangements will be made to transpose the comments to the bug database.  
			All feedback is welcome.
		</p>
		<p>
			Publication as a Editor's Draft does not imply endorsement by the W3C Membership. 
			This is a draft document and may be updated, replaced or obsoleted by other documents at any time. 
			It is inappropriate to cite this document as other than work in progress.</p>
		<p>
			This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>.
			W3C maintains a <a href="http://www.w3.org/2004/01/pp-impl/40318/status" rel="disclosure">public list of any patent disclosures</a>
			made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has 
			actual knowledge of a patent which the individual believes contains <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> 
			must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>.
		</p>
<!--End of Status of This Document-->
	</div>

<!-- TOC -->
<div class="section" id="toc">
<h2 class="introductory">Table of Contents</h2>
	<ul class="toc">
		<li class="tocline"><a class="tocxref" href="#introduction"><span class="secno">1. </span>Introduction</a></li>
		<li class="tocline"><a class="tocxref" href="#PI-and-xml"><span class="secno">2. </span>Processing Instructions and the XML Declaration</a></li>
		<li class="tocline"><a class="tocxref" href="#character-encoding"><span class="secno">3. </span>Specifying a Document's Character Encoding</a></li>
		<li class="tocline"><a class="tocxref" href="#doctype"><span class="secno">4. </span>The DOCTYPE</a></li>
		<li class="tocline"><a class="tocxref" href="#namespaces"><span class="secno">5. </span>Namespaces</a>
			<ul class="toc">
				<li class="tocline"><a class="tocxref" href="#element-level-namespaces"><span class="secno">5.1 </span>Element-Level Namespaces</a></li>
				<li class="tocline"><a class="tocxref" href="#attribute-level-namespaces"><span class="secno">5.2 </span>Attribute-Level Namespaces</a></li>
			</ul>
		</li>
		<li class="tocline"><a class="tocxref" href="#elements"><span class="secno">6. </span>Elements</a>
			<ul class="toc">
				<li class="tocline"><a class="tocxref" href="#required-elements"><span class="secno">6.1 </span>Required Elements</a></li>
				<li class="tocline"><a class="tocxref" href="#elements-that-cannot-be-used"><span class="secno">6.2 </span>Elements that Cannot Be Used in Polyglot Markup</a></li>
				<li class="tocline"><a class="tocxref" href="#case-sensitivity"><span class="secno">6.3 </span>Case-Sensitivity</a>
					<ul class="toc">
						<li class="tocline"><a class="tocxref" href="#element-names"><span class="secno">6.3.1 </span>Element Names</a></li>
						<li class="tocline"><a class="tocxref" href="#attribute-names"><span class="secno">6.3.2 </span>Attribute Names</a></li>
						<li class="tocline"><a class="tocxref" href="#attribute-values"><span class="secno">6.3.3 </span>Attribute Values</a></li>
					</ul>
				</li>
				<li class="tocline"><a class="tocxref" href="#empty-elements"><span class="secno">6.4 </span>Void Elements</a></li>
				<li class="tocline"><a class="tocxref" href="#elements-with-special-considerations"><span class="secno">6.5 </span>Elements with Special Considerations</a>
					<ul class="toc">
						<li class="tocline"><a class="tocxref" href="#http-headers-and-http-equiv"><span class="secno">6.5.1 </span>HTTP Headers and http-equiv Declarations</a>
							<ul class="toc">
								<li class="tocline"><a class="tocxref" href="#content-language"><span class="secno">6.5.1.1 </span>Content-Language</a></li>
								<li class="tocline"><a class="tocxref" href="#content-type"><span class="secno">6.5.1.2 </span>Content-Type</a></li>
							</ul>
						</li>
						<li class="tocline"><a class="tocxref" href="#newlines-in-textarea-and-pre"><span class="secno">6.5.2 </span>Newlines in <code>textarea</code> and <code>pre</code> Elements</a></li>
					</ul>
				</li>
			</ul>
		</li>
		<li class="tocline"><a class="tocxref" href="#attributes"><span class="secno">7. </span>Attributes</a>
			<ul class="toc">
				<li class="tocline"><a class="tocxref" href="#disallowed-attributes"><span class="secno">7.1 </span>Disallowed Attributes</a></li>
				<li class="tocline"><a class="tocxref" href="#language-attributes"><span class="secno">7.2 </span>Language Attributes</a></li>
				<li class="tocline"><a class="tocxref" href="#attributes-with-special-considerations"><span class="secno">7.3 </span>Attributes with Special Considerations</a>
					<ul class="toc">
						<li class="tocline"><a class="tocxref" href="#id-attribute"><span class="secno">7.3.1 </span>The <code>id</code> Attribute</a></li>
					</ul>
				</li>
			</ul>
		</li>
		<li class="tocline"><a class="tocxref" href="#named-entity-references"><span class="secno">8. </span>Named Entity References</a></li>
		<li class="tocline"><a class="tocxref" href="#script-and-style"><span class="secno">9. </span>Script and Style</a>
			<ul class="toc">
				<li class="tocline"><a class="tocxref" href="#external-script-and-style"><span class="secno">9.1 </span>External Script and Style</a></li>
				<li class="tocline"><a class="tocxref" href="#in-line-script-and-style"><span class="secno">9.2 </span>In-line Script and Style</a></li>
			</ul>
		</li>
		<li class="tocline"><a class="tocxref" href="#comments"><span class="secno">10. </span>Comments in Polyglot Markup</a></li>
		<li class="tocline"><a class="tocxref" href="#foreign-content"><span class="secno">11. </span>Exceptions from the Foreign Content Parsing Rules</a></li>
		<li class="tocline"><a class="tocxref" href="#example-document"><span class="secno">12. </span>Example Document</a></li>
		<li class="tocline"><a class="tocxref" href="#acknowledgements"><span class="secno">A. </span>Acknowledgements</a></li>
		<li class="tocline"><a class="tocxref" href="#references"><span class="secno">B. </span>References</a>
			<ul class="toc">
				<li class="tocline"><a class="tocxref" href="#normative-references"><span class="secno">B.1 </span>Normative references</a></li>
				<li class="tocline"><a class="tocxref" href="#informative-references"><span class="secno">B.2 </span>Informative references</a></li>
			</ul>
		</li>
	</ul>
</div>
<!-- End TOC -->


<div id="introduction" class="section informative">
<!--OddPage--><h2><span class="secno">1. </span>Introduction</h2><p><em>This section is non-normative.</em></p>
	<p>
		It is often valuable to be able to serve HTML5 documents that are also well formed XML documents. 
		An author may, for example, use XML tools to generate a document, and they and others may process the document using XML tools. 
		The language used to create documents that can be parsed by both HTML and XML parsers is called <dfn id="dfn-polyglot-markup">polyglot markup</dfn>.
		<a class="internalDFN" href="#dfn-polyglot-markup" title="polyglot markup">Polyglot markup</a> is 
		the overlap language of documents that are both HTML5 documents and XML documents. 
		It is recommended that these documents be served as either <code>text/html</code> (if the content is transmitted to an HTML-aware user agent) 
		or <code>application/xhtml+xml</code> (if the content is transmitted to an XHTML-aware user agent).
		Other permissible MIME types are <code>text/xml</code>, <code>application/xml</code>, 
		and any MIME type whose subtype ends with the four characters "<code>+xml</code>". [<cite><a href="#bib-XML-MT" rel="biblioentry" class="bibref">XML-MT</a></cite>]
	</p>
	<p>
		<a class="internalDFN" href="#dfn-polyglot-markup" title="polyglot markup">Polyglot markup</a> results in:
	</p>
	<ul>
		<li>a valid HTML document. [<cite><a href="#bib-HTML5" rel="biblioentry" class="bibref">HTML5</a></cite>]</li>
		<li>
			a <a href="http://www.w3.org/TR/2008/PER-xml-20080205/#sec-well-formed">well-formed XML</a> document. 
			[<cite><a href="#bib-XML10" rel="biblioentry" class="bibref">XML10</a></cite>]
		</li>
		<li>
			identical DOMs when processed as HTML and when processed as XML. 
			A noteable exception to this is that HTML and XML parsers generate different DOMs for 
			some <code>xml</code> (<code>xml:lang</code>, <code>xml:space</code>, and <code>xml:base</code>), 
			<code>xmlns</code> (<code>xmlns=""</code> and <code>xmlns:xlink=""</code>), and <code>xlink</code> (such as <code>xlink:href</code>) attributes. 
			XML requires and HTML5 permits these attributes in certain locations and the attributes are preserved by HTML parsers.
		</li>			
	</ul>
	<p>
		<a class="internalDFN" href="#dfn-polyglot-markup" title="polyglot markup">Polyglot markup</a> is not constrained: 
	</p>
	<ul>
		<li>
			to be <a href="http://www.w3.org/TR/2008/PER-xml-20080205/#dt-valid">valid XML</a>. 
			[<cite><a href="#bib-XML10" rel="biblioentry" class="bibref">XML10</a></cite>]
		</li>
		<li>by conformance to any XML DTD.</li>
	</ul>
	<p>
		<a class="internalDFN" href="#dfn-polyglot-markup" title="polyglot markup">Polyglot markup</a> is 
		scripted according to the rules of XML (does not use <code>document.write</code>, for example) 
		and excludes HTML elements that are impossible to replicate in an XML parser (does not use the <code>noscript</code> element, for example).
		<a class="internalDFN" href="#dfn-polyglot-markup" title="polyglot markup">Polyglot markup</a> triggers non-quirks mode in HTML parsers, 
		as non-quirks mode is closest to XML-mode rendering, in regard to both DOM and CSS.
		<a class="internalDFN" href="#dfn-polyglot-markup" title="polyglot markup">Polyglot markup</a> results in 
		the same encoding and the same language in both HTML-mode and XML-mode.
	</p>
	<p>
		All web content need not be authored in <a class="internalDFN" href="#dfn-polyglot-markup">polyglot markup</a>.
		<a class="internalDFN" href="#dfn-polyglot-markup" title="polyglot markup">Polyglot markup</a> is ideal for publishing when 
		there's a strong desire to serve both HTML and XML tool chains 
		without simultaneously having to maintain dual copies of the content: one in HTML and a second in XHTML. 
		In addition, a single <a class="internalDFN" href="#dfn-polyglot-markup">polyglot markup</a> output requires 
		less infrastructure to produce than to produce both HTML and XHTML output for the same content. 
		<a class="internalDFN" href="#dfn-polyglot-markup" title="polyglot markup">Polyglot markup</a> is also be beneficial when lightweight processes—such as 
		quick testing or even hand-authoring—are applied to content intended to be published both as HTML and XHTML, 
		especially if that content is not sent through a tool chain. 
	</p>
<!--End section: Introduction-->
</div>

<!-- Add Content HERE -->


<!-- Appendix -->
<div id="acknowledgements" class="appendix section">
<h2><span class="secno">A. </span>Acknowledgements</h2>
	<p>
		Many thanks to Robin Berjon, David Carlisle, Daniel Glazman, Richard Ishida, Tony Ross, 
		Sam Ruby, Jonas Sicking, Leif Halvard Silli, Henri Sivonen, Manu Sporny, and Philip Taylor. 
		Special thanks to the W3C TAG and the W3C Internationalization (i18n) Core Working Group.
	</p>
</div>

<div class="appendix section" id="references">
<h2><span class="secno">B. </span>References</h2>

	<div class="section" id="normative-references">
	<h3><span class="secno">B.1 </span>Normative references</h3>
	
		<dl class="bibliography">
			<dt id="bib-CHARMOD">[CHARMOD]</dt>
			<dd>Martin J. Dürst; et al. <a href="http://www.w3.org/TR/2005/REC-charmod-20050215"><cite>Character Model for the World Wide Web 1.0: Fundamentals.</cite></a> 
			15 February 2005. W3C Recommendation. URL: <a href="http://www.w3.org/TR/2005/REC-charmod-20050215">http://www.w3.org/TR/2005/REC-charmod-20050215</a>
			</dd>
			<dt id="bib-HTML5">[HTML5]</dt>
			<dd>Ian Hickson; David Hyatt. <a href="http://www.w3.org/TR/2010/WD-html5-20100304/"><cite>HTML 5.</cite></a> 4 March 2010. W3C Working Draft. (Work in progress.) 
			URL: <a href="http://www.w3.org/TR/2010/WD-html5-20100304/">http://www.w3.org/TR/2010/WD-html5-20100304/</a> 
			</dd>
			<dt id="bib-HTTP11">[HTTP11]</dt>
			<dd>R. Fielding; et al. <a href="http://www.ietf.org/rfc/rfc2616.txt"><cite>Hypertext Transfer Protocol - HTTP/1.1.</cite></a> June 1999. Internet RFC 2616. URL: 
			<a href="http://www.ietf.org/rfc/rfc2616.txt">http://www.ietf.org/rfc/rfc2616.txt</a> 
			</dd>
			<dt id="bib-RFC2854">[RFC2854]</dt>
			<dd>D. Connolly; L. Masinter. <a href="http://www.rfc-editor.org/rfc/rfc2854.txt"><cite>The 'text/html' Media Type.</cite></a> June 2000. Internet RFC 2854. URL: 
			<a href="http://www.rfc-editor.org/rfc/rfc2854.txt">http://www.rfc-editor.org/rfc/rfc2854.txt</a> 
			</dd>
			<dt id="bib-XML-MT">[XML-MT]</dt>
			<dd>M. Murata, S. St.Laurent, D. Kohn. <a href="http://www.ietf.org/rfc/rfc3023.txt"><cite>XML Media Types</cite></a>. IETF RFC 3023. URI: 
			<a href="http://www.ietf.org/rfc/rfc3023.txt"> http://www.ietf.org/rfc/rfc3023.txt</a>.
			</dd>
			<dt id="bib-XML10">[XML10]</dt><dd>C. M. Sperberg-McQueen; et al. <a href="http://www.w3.org/TR/2008/REC-xml-20081126/"><cite>Extensible Markup Language (XML) 1.0 (Fifth Edition).</cite></a> 
			26 November 2008. W3C Recommendation. URL: <a href="http://www.w3.org/TR/2008/REC-xml-20081126/">http://www.w3.org/TR/2008/REC-xml-20081126/</a> 
			</dd>
		</dl>
	</div>
	
	<div class="section" id="informative-references">
	<h3><span class="secno">B.2 </span>Informative references</h3>
		<p>
			No informative references.
		</p>
	</div>
</div>
<!-- End Appendix -->

</body>
</html>
Received on Friday, 8 April 2011 21:01:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 8 April 2011 21:03:10 GMT