- From: CVS User egraff <cvsmail@w3.org>
- Date: Mon, 18 Mar 2013 20:45:55 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/html-xhtml-author-guide In directory roscoe:/tmp/cvs-serv23628 Modified Files: html-xhtml-authoring-guide.html Log Message: Minor edit for bug 18829 --- /sources/public/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html 2012/07/09 21:27:04 1.85 +++ /sources/public/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html 2013/03/18 20:45:55 1.86 @@ -1,259 +1,133 @@ -<!DOCTYPE html> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> + +<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://dev.w3.org/2009/dap/ReSpec.js/css/respec.css"/> - <link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-ED"/> + <meta charset='utf-8'> + <script class=remove src="http://www.w3.org/Tools/respec/respec-w3c-common" async></script> + <script class=remove> + var respecConfig = { + specStatus: "ED", + shortName: "html-polyglot", + // publishDate: "2012-03-13", + previousPublishDate: "2010-10-19", + previousMaturity: "WD", + edDraftURI: "http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide-ED-COPY.htm", + // lcEnd: "2009-08-05", + editors: [ + { name: "Eliot Graff", company: "Microsoft Corporation" }, + ], + wg: "HTML working group", + wgURI: "http://www.w3.org/html/wg/", + wgPublicList: "public-html", + wgPatentURI: "http://www.w3.org/2004/01/pp-impl/40318/status", + }; + </script> </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-9-july-2012">W3C Editor's Draft 9 July 2012</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-20110525/">http://www.w3.org/TR/2011/WD-html-polyglot-20110525/</a></dd> - <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> © 2011 - <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</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—normally lower case but occasionally camel case—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="#example-document"><span class="secno">11. </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 --> +<body> +<section id=abstract> + A document that uses polyglot markup is a document that is a stream of bytes that parses into identical document trees + (with some exceptions, as noted in the <a href="#introduction">Introduction</a>) 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—normally lower case but occasionally camel case—for element and attribute names. + Polyglot markup uses lower case for certain attribute values. + Further constraints include those on void elements, named entity references, and the use of scripts and style. +<!--End section: Abstract--> +</section> + +<section id="sotd"> + <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 [[!HTML5]] and [[!RFC2854]]. + </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 by email to the mailing list. + </p> +<!--End section: Status of This Document--> +</section> -<div id="introduction" class="section informative"> -<!--OddPage--><h2><span class="secno">1. </span>Introduction</h2><p><em>This section is non-normative.</em></p> +<section id="introduction" class="informative"> +<h2>Introduction</h2> <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. + The language used to create documents that can be parsed by both HTML and XML parsers is called <dfn>polyglot markup</dfn>. + <a 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>] + and any MIME type whose subtype ends with the four characters "<code>+xml</code>". [[!XML-MT]] </p> <p> - <a class="internalDFN" href="#dfn-polyglot-markup" title="polyglot markup">Polyglot markup</a> results in: + <a 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>a valid HTML document. [[!HTML5]]</li> + <li>a <a href="http://www.w3.org/TR/2008/PER-xml-20080205/#sec-well-formed">well-formed XML</a> document. [[!XML10]]</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: + <a 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>to be <a href="http://www.w3.org/TR/2008/PER-xml-20080205/#dt-valid">valid XML</a>. [[!XML10]]</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) + <a 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, + <a 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. + <a 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 + All web content need not be authored in <a>polyglot markup</a>. + <a 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, + In addition, a single <a>polyglot markup</a> output requires less infrastructure to produce than to produce both HTML and XHTML output for the same content. + <a 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> +</section> -<div id="PI-and-xml" class="section"> -<!--OddPage--><h2><span class="secno">2. </span>Processing Instructions and the XML Declaration</h2> +<section id="PI-and-xml" class="section"> +<h2>Processing Instructions and the XML Declaration</h2> <p> - Processing Instructions and the XML Declaration are both forbidden in <a class="internalDFN" href="#dfn-polyglot-markup">polyglot markup</a>. + Processing Instructions and the XML Declaration are both forbidden in <a>polyglot markup</a>. </p> <!--End section: Processing Instructions and the XML Declaration--> -</div> +</section> -<div id="character-encoding" class="section"> -<!--OddPage--><h2><span class="secno">3. </span>Specifying a Document's Character Encoding</h2> +<section id="character-encoding" class="section"> +<h2>Specifying a Document's Character Encoding</h2> <p> Polyglot markup uses the UTF-8 character encoding, the only character encoding for which both HTML and XML require support. - HTML requires UTF-8 to be explicitly declared to avoid <a href="http://www.w3.org/TR/html5/semantics.html#charset">fallback to a legacy encoding</a> [<cite><a href="#bib-HTML5" rel="biblioentry" class="bibref">HTML5</a></cite>]. + HTML requires UTF-8 to be explicitly declared to avoid <a href="http://www.w3.org/TR/html5/semantics.html#charset">fallback to a legacy encoding</a> [[!HTML5]]. For XML, UTF-8 is an <a href="http://www.w3.org/TR/2008/REC-xml-20081126/#charencoding">encoding default</a>. - As such, character encoding <em title="may" class="rfc2119">may</em> be left undeclared in XML with the result that UTF-8 is still supported [<cite><a href="#bib-XML10" rel="biblioentry" class="bibref">XML10</a></cite>]. + As such, character encoding MAY be left undeclared in XML with the result that UTF-8 is still supported [[!XML10]]. </p> <p> - <a class="internalDFN" href="#dfn-polyglot-markup" title="polyglot markup">Polyglot markup</a> declares the UTF-8 character encoding in the following ways, which may be used separately or in combination: + <a title="polyglot markup">Polyglot markup</a> declares the UTF-8 character encoding in the following ways, which may be used separately or in combination: </p> <ul> <li>Within the document @@ -264,31 +138,31 @@ </li> <li>Outside the document <ul> - <li>By adding <code>"charset=utf-8"</code> to the MIME/HTTP Content-Type header [<cite><a href="#bib-HTTP11" rel="biblioentry" class="bibref">HTTP11</a></cite>], as the following examples show in HTML and XML, respectively: </li> + <li>By adding <code>"charset=utf-8"</code> to the MIME/HTTP Content-Type header [[!HTTP11]], as the following examples show in HTML and XML, respectively: </li> </ul> - <pre class="example"><code>Content-type: text/html; charset=utf-8</code></pre> - <pre class="example"><code>Content-type: application/xhtml+xml; charset=utf-8</code></pre> + <pre class="example"> + <code>Content-type: text/html; charset=utf-8</code> + </pre> + <pre class="example"> + <code>Content-type: application/xhtml+xml; charset=utf-8</code> + </pre> </li> </ul> <p class="note"> The HTML encoding declaration has no effect in XML. - When the HTML encoding declaration is the only encoding declaration, -the encoding default from XML makes XML parsers treat content as UTF-8. + When the HTML encoding declaration is the only encoding declaration, the encoding default from XML makes XML parsers treat content as UTF-8. </p> <p> - The <a href="http://www.w3.org/International/questions/qa-html-encoding-declarations"><acronym title="World Wide Web Consortium">W3C</acronym> Internationalization (i18n) Group recommends</a> - to always include - a visible encoding declaration in a document, because it helps -developers, testers, or translation production managers to check the -encoding of a document visually. + The <a href="http://www.w3.org/International/questions/qa-html-encoding-declarations">W3C Internationalization (i18n) Group recommends</a> to always include + a visible encoding declaration in a document, because it helps developers, testers, or translation production managers to check the encoding of a document visually. </p> <!--End section: Specifying a Document's Character Encoding--> -</div> +</section> -<div id="doctype" class="section"> -<!--OddPage--><h2><span class="secno">4. </span>The DOCTYPE</h2> +<section id="doctype" class="section"> +<h2>The DOCTYPE</h2> <p> - <a class="internalDFN" href="#dfn-polyglot-markup" title="polyglot markup">Polyglot markup</a> uses a document type declaration (DOCTYPE) specified by <a href="http://www.w3.org/TR/html5/syntax.html#the-doctype">section 8.1.1</a> of [<cite><a href="#bib-HTML5" rel="biblioentry" class="bibref">HTML5</a></cite>]. + <a title="polyglot markup">Polyglot markup</a> uses a document type declaration (DOCTYPE) specified by <a href="http://www.w3.org/TR/html5/syntax.html#the-doctype">section 8.1.1</a> of [[!HTML5]]. In addition, the DOCTYPE conforms to the following rules: </p> <ul> @@ -299,7 +173,7 @@ <li>A Formal Public Identifier (FPI), if present, is a case-sensitive match of the registered FPI to which it points.</li> <li>A URI, if present in the document type declaration, is a case-sensitive match of the URI to which it points. <ul> - <li>If the URI is the string <code>about:legacy-compat</code>, <a class="internalDFN" href="#dfn-polyglot-markup">polyglot markup</a> includes the string in lowercase letters, as required by HTML5.</li> + <li>If the URI is the string <code>about:legacy-compat</code>, <a>polyglot markup</a> includes the string in lowercase letters, as required by HTML5.</li> [817 lines skipped]
Received on Monday, 18 March 2013 20:45:58 UTC