- From: Eliot Graff via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 14 Oct 2010 17:53:51 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/html-xhtml-author-guide In directory hutz:/tmp/cvs-serv1792 Modified Files: WD-html-polyglot-20101017.htm Log Message: Charset changed to utf-8 Index: WD-html-polyglot-20101017.htm =================================================================== RCS file: /sources/public/html5/html-xhtml-author-guide/WD-html-polyglot-20101017.htm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- WD-html-polyglot-20101017.htm 14 Oct 2010 17:10:19 -0000 1.4 +++ WD-html-polyglot-20101017.htm 14 Oct 2010 17:53:49 -0000 1.5 @@ -1,10 +1,10 @@ -<!DOCTYPE HTML> +<!DOCTYPE HTML> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" xml:lang="en" lang="en"> <head> - <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> + <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Polyglot Markup: HTML-Compatible XHTML Documents</title> @@ -487,27 +487,37 @@ <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> + <h1 class="title" id="title">Polyglot Markup: HTML-Compatible XHTML + Documents</h1> <h2 id="w3c-working-draft-17-october-2010">W3C Working Draft 17 October 2010</h2> <dl> <dt>This version:</dt> - <dd><a href="http://www.w3.org/TR/2010/WD-html-polyglot-20101017/">http://www.w3.org/TR/2010/WD-html-polyglot-20101017/</a></dd> + <dd><a href="http://www.w3.org/TR/2010/WD-html-polyglot-20101017/"> + http://www.w3.org/TR/2010/WD-html-polyglot-20101017/</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/html-xhtml-authoring-guide.html">http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html</a></dd> - <dt>Previous version:</dt><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/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/html-xhtml-authoring-guide.html"> + http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html</a></dd> + <dt>Previous version:</dt><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> <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> © 2010 - <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> + <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"> + Copyright</a> © 2010 + <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. + <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> <hr/> </div> @@ -515,60 +525,68 @@ <div class="introductory section" id="abstract"> <h2>Abstract</h2> A document that uses polyglot markup is 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. + 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 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> + <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>] + 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 a Working Draft. - This document is intended to become a W3C Recommendation. - 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> + This document was published by the <a href="http://www.w3.org/html/wg/"> + HTML working group</a> as a Working Draft. This document is intended to + become a W3C Recommendation. 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. + archives</a>) and arrangements will be made to transpose the comments to + the bug database. All feedback is welcome. </p> <p> - Publication as a Working 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. + Publication as a Working 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>. + 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 Status of This Document--> </div> @@ -576,63 +594,95 @@ <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> + <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> + <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> + <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> + <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> + <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> + <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>Empty Elements</a></li> - <li class="tocline"><a class="tocxref" href="#elements-with-soecial-considerations"><span class="secno">6.5 </span> + <li class="tocline"><a class="tocxref" href="#empty-elements"><span class="secno"> + 6.4 </span>Empty Elements</a></li> + <li class="tocline"><a class="tocxref" href="#elements-with-soecial-considerations"><span class="secno"> + 6.5 </span> Elements with Special Considerations</a> <ul class="toc"> - <li class="tocline"><a class="tocxref" href="#white-space-in-textarea-and-pre"><span class="secno">6.5.1 </span> - White Space in <code><textarea></code> and <code><pre></code> Elements</a></li> + <li class="tocline"><a class="tocxref" href="#white-space-in-textarea-and-pre"><span class="secno"> + 6.5.1 </span> + White Space 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> + <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="#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> </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> + <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 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> <ul class="toc"> - <li class="tocline"><a class="tocxref" href="#safe-content"><span class="secno">9.2.1 </span>Safe Content</a></li> - <li class="tocline"><a class="tocxref" href="#wrapping-in-cdata"><span class="secno">9.2.2 </span> + <li class="tocline"><a class="tocxref" href="#safe-content"><span class="secno"> + 9.2.1 </span>Safe Content</a></li> + <li class="tocline"><a class="tocxref" href="#wrapping-in-cdata"><span class="secno"> + 9.2.2 </span> Wrapping a Command in a CDATA Section</a></li> </ul> </li> </ul> </li> - <li class="tocline"><a class="tocxref" href="#foreign-content"><span class="secno">10. </span>Exceptions from the Foreign Content Parsing Rules</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> + <li class="tocline"><a class="tocxref" href="#foreign-content"><span class="secno"> + 10. </span>Exceptions from the Foreign Content Parsing Rules</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> + <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> @@ -643,40 +693,44 @@ <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 - valid 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. - These documents are served as text/html. - 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>. - Polyglot markup is the overlap language of documents which are both HTML5 documents and XML documents. + It is often valuable to be able to serve HTML5 documents that are also + valid 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. These documents are served as text/html. 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>. Polyglot + markup is the overlap language of documents which are both HTML5 + documents and XML documents. </p> <!--End section 1: Introduction--> </div> <div id="PI-and-xml" class="section"> -<h2><span class="secno">2. </span>Processing Instructions and the XML Declaration</h2> +<h2><span class="secno">2. </span>Processing Instructions and the XML +Declaration</h2> <p> - Processing Instructions and the XML Declaration are both forbidden in polyglot markup. + Processing Instructions and the XML Declaration are both forbidden in + polyglot markup. </p> <!--End section: Processing Instructions and the XML Declaration--> </div> <div id="character-encoding" class="section"> -<h2><span class="secno">3. </span>Specifying a Document's Character Encoding</h2> +<h2><span class="secno">3. </span>Specifying a Document's Character Encoding</h2> <p> - Polyglot markup uses either UTF-8 or UTF-16. UTF-8 is preferred. - When polyglot markup uses UTF-16, it <em title="must not" class="rfc2119">must not</em> include a BOM. - When polyglot markup uses UTF-16, it <em title="must" class="rfc2119">must</em> include the BOM indicating - little-endian UTF-16 or big-endian UTF-16. + Polyglot markup uses either UTF-8 or UTF-16. UTF-8 is preferred. When + polyglot markup uses UTF-16, it <em title="must not" class="rfc2119"> + must not</em> include a BOM. When polyglot markup uses UTF-16, it <em title="must" class="rfc2119"> + must</em> include the BOM indicating little-endian UTF-16 or big-endian + UTF-16. </p> <p> Polyglot markup declares character encoding one of two ways: </p><ul> <li>By using the BOM.</li> - <li>In the HTTP header of the response [<cite><a href="#bib-HTTP11" rel="biblioentry" class="bibref">HTTP11</a></cite>], as in the following: + <li>In the HTTP header of the response [<cite><a href="#bib-HTTP11" rel="biblioentry" class="bibref">HTTP11</a></cite>], + as in the following: <p> <code>Content-type: text/html; charset=utf-8</code> <br> @@ -684,20 +738,23 @@ <br> <code>Content-type: text/html; charset=utf-16</code> </p> - Note that polyglot markup may use either <code>text/html</code> or <code>application/xhtml+xml</code> for the value of the content type. + Note that polyglot markup may use either <code>text/html</code> + or <code>application/xhtml+xml</code> for the value of the content + type. </li> </ul> <p></p> <p> - Using <code><meta charset="*"/></code> has no effect in XML. - Therefore, polyglot markup <em title="may" class="rfc2119">may</em> use <code><meta charset="*"/></code> in combination with BOM, - as long the meta element specifies the same character encoding as the BOM. - In addition, the meta tag <em title="may" class="rfc2119">may</em> be used in the absence of a BOM as long as it matches the already specified encoding. - Note that 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 the declaration helps developers, testers, or translation -production managers - to check the encoding of a document visually. + Using <code><meta charset="*"/></code> has no effect in XML. Therefore, + polyglot markup <em title="may" class="rfc2119">may</em> use <code><meta + charset="*"/></code> in combination with BOM, as long the meta element + specifies the same character encoding as the BOM. In addition, the meta + tag <em title="may" class="rfc2119">may</em> be used in the absence of a + BOM as long as it matches the already specified encoding. Note that 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 + the declaration 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> @@ -705,19 +762,27 @@ <div id="doctype" class="section"> <h2><span class="secno">4. </span>The DOCTYPE</h2> <p> - Polyglot markup <em title="must" class="rfc2119">must</em> have 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>]. - In addition, the DOCTYPE <em title="must" class="rfc2119">must</em> conform to the following rules: + Polyglot markup <em title="must" class="rfc2119">must</em> have 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>]. + In addition, the DOCTYPE <em title="must" class="rfc2119">must</em> + conform to the following rules: </p> <ul> <li>The string <code>DOCTYPE</code> is in uppercase letters.</li> <li>The string <code>html</code> is in lowercase letters.</li> <li>The string <code>SYSTEM</code>, if present, is in uppercase letters.</li> <li>The string <code>PUBLIC</code>, if present, is in uppercase letters.</li> - <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. + <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>, the string <em title="must" class="rfc2119">must</em> be in lowercase, as required by HTML5.</li> - <li>If the URI is an http URL, the URI must point to the correct resource, using case-sensitive letters.</li> + <li>If the URI is the string <code>about:legacy-compat</code>, + the string <em title="must" class="rfc2119">must</em> be in + lowercase, as required by HTML5.</li> + <li>If the URI is an http URL, the URI must point to the correct + resource, using case-sensitive letters.</li> </ul> </li> </ul> @@ -740,20 +805,23 @@ <div id="element-level-namespaces" class="section"> <h3><span class="secno">5.1 </span>Element-Level Namespaces</h3> <p> - [<cite><a href="#bib-HTML5" rel="biblioentry" class="bibref">HTML5</a></cite>] introduces undeclared (native) default namespaces for the - root HTML element <code><html></code>, the root SVG element <code><svg></code>, and the root MathML element <code><math></code>. - The following default namespaces <em title="must" class="rfc2119">must</em> be declared in polyglot markup, to maintain - XML-compatibility [<cite><a href="#bib-XML10" rel="biblioentry" class="bibref">XML10</a></cite>]: + [<cite><a href="#bib-HTML5" rel="biblioentry" class="bibref">HTML5</a></cite>] + introduces undeclared (native) default namespaces for the root HTML + element <code><html></code>, the root SVG element <code><svg></code>, + and the root MathML element <code><math></code>. The following + default namespaces <em title="must" class="rfc2119">must</em> be + declared in polyglot markup, to maintain XML-compatibility [<cite><a href="#bib-XML10" rel="biblioentry" class="bibref">XML10</a></cite>]: </p><ul> - <li><code><html xmlns="http://www.w3.org/1999/xhtml"></code></li> - <li><code><math xmlns="http://www.w3.org/1998/Math/MathML"></code></li> - <li><code><svg xmlns="http://www.w3.org/2000/svg"></code></li> + <li><code><html xmlns="http://www.w3.org/1999/xhtml"></code></li> + <li><code><math xmlns="http://www.w3.org/1998/Math/MathML"></code></li> + <li><code><svg xmlns="http://www.w3.org/2000/svg"></code></li> </ul> <p></p> <p> - Polyglot markup <em title="must not" class="rfc2119">must not</em> declare any other default or prefixed element namespace, - because [<cite><a href="#bib-HTML5" rel="biblioentry" class="bibref">HTML5</a></cite>] does not natively support the declaring of - any other default or prefixed element namespace. + Polyglot markup <em title="must not" class="rfc2119">must not</em> + declare any other default or prefixed element namespace, because [<cite><a href="#bib-HTML5" rel="biblioentry" class="bibref">HTML5</a></cite>] + does not natively support the declaring of any other default or + prefixed element namespace. </p> <!--End section: Element-Level Namespaces--> </div> @@ -761,13 +829,15 @@ <div id="attribute-level-namespaces" class="section"> <h3><span class="secno">5.2 </span>Attribute-Level Namespaces</h3> <p> - [<cite><a href="#bib-HTML5" rel="biblioentry" class="bibref">HTML5</a></cite>] introduces undeclared (native) support for attributes in the - XLink namespace and with the prefix <code>xlink:</code>. - Polyglot markup <em title="must" class="rfc2119">must</em> declare the XLink namespace on the HTML root element - (<code><html></code>) or once on the foreign element where is used (<code><svg></code> or <code><mathml></code>), - to maintain XML-compatibility [<cite><a href="#bib-XML10" rel="biblioentry" class="bibref">XML10</a></cite>]. + [<cite><a href="#bib-HTML5" rel="biblioentry" class="bibref">HTML5</a></cite>] + introduces undeclared (native) support for attributes in the XLink + namespace and with the prefix <code>xlink:</code>. Polyglot markup <em title="must" class="rfc2119"> + must</em> declare the XLink namespace on the HTML root element (<code><html></code>) + or once on the foreign element where is used (<code><svg></code> or <code> + <mathml></code>), to maintain XML-compatibility [<cite><a href="#bib-XML10" rel="biblioentry" class="bibref">XML10</a></cite>]. </p> - <p>In polyglot markup, the xlink prefix uses the namespace declaration <code>xmlns:xlink="http://www.w3.org/1999/xlink"</code> + <p>In polyglot markup, the xlink prefix uses the namespace declaration <code> + xmlns:xlink="http://www.w3.org/1999/xlink"</code> before using the xlink prefix for the following elements: </p><ul> <li><code>xlink:actuate</code></li> @@ -778,12 +848,15 @@ <li><code>xlink:title</code></li> <li><code>xlink:type</code></li> </ul> - Furthermore, polyglot markup defines the xlink prefix only on foreign elements (any SVG or MathML element) but not the root + Furthermore, polyglot markup defines the xlink prefix only on + foreign elements (any SVG or MathML element) but not the root <code><html></code> element or any other HTML element. <p> - Note that there are other prefixed attributes that can be used beyond <code>xlink:href</code> (such as <code>xml:base</code>). - Polyglot markup does not declare these prefixes via xmlns. - The prefixes are implicitly declared in XML and are automatically applied to the appropriate attributes in HTML. + Note that there are other prefixed attributes that can be used + beyond <code>xlink:href</code> (such as <code>xml:base</code>). + Polyglot markup does not declare these prefixes via xmlns. The + prefixes are implicitly declared in XML and are automatically + applied to the appropriate attributes in HTML. </p> <!--End section: Attribute-Level Namespaces--> </div> @@ -797,9 +870,12 @@ <div id="required-elements" class="section"> <h3><span class="secno">6.1 </span>Required Elements</h3> <p> - Polyglot markup <em title="must" class="rfc2119">must</em> explicitly have a <code>tbody</code> element surrounding groups of <code>tr</code> - elements within a <code>table</code> element. - HTML parsers insert the <code>tbody</code> element, but XML parsers do not, thus creating different DOMs. + Polyglot markup <em title="must" class="rfc2119">must</em> + explicitly have a <code>tbody</code> element surrounding groups of <code> + tr</code> + elements within a <code>table</code> element. HTML parsers insert + the <code>tbody</code> element, but XML parsers do not, thus + creating different DOMs. </p> <p> Correct: @@ -811,9 +887,12 @@ <pre class="example"><table> <tr>...</pre> <p> - Polyglot markup <em title="must" class="rfc2119">must</em> explicitly have a <code>colgroup</code> element surrounding groups of - <code>col</code> elements within a <code>table</code> element. - HTML parsers insert the <code>colgroup</code> element, but XML parsers do not, thus creating different DOMs. + Polyglot markup <em title="must" class="rfc2119">must</em> + explicitly have a <code>colgroup</code> element surrounding groups + of + <code>col</code> elements within a <code>table</code> element. HTML + parsers insert the <code>colgroup</code> element, but XML parsers do + not, thus creating different DOMs. </p> <p> Correct: @@ -829,9 +908,11 @@ <div id="elements-that-cannot-be-used" class="section"> - <h3><span class="secno">6.2 </span>Elements that Cannot Be Used in Polyglot Markup</h3> - <p>Polyglot markup does not use the <code><noscript></code> element, because the <code><noscript></code> element must not be used - in XML documents. [<cite><a href="#bib-HTML5" rel="biblioentry" class="bibref">HTML5</a></cite>]</p> + <h3><span class="secno">6.2 </span>Elements that Cannot Be Used in Polyglot + Markup</h3> + <p>Polyglot markup does not use the <code><noscript></code> element, + because the <code><noscript></code> element must not be used in XML + documents. [<cite><a href="#bib-HTML5" rel="biblioentry" class="bibref">HTML5</a></cite>]</p> <!--End section: Elements that Cannot Be Used in Polyglot Markup--> </div> @@ -840,10 +921,11 @@ <h3><span class="secno">6.3 </span>Case-Sensitivity</h3> <p> The following guidelines apply to any usage of element names, -attribute names, or attribute values in markup, script, or CSS. - Polyglot markup uses lower case letters for all ASCII letters. - For non-ASCII letters—such as Greek, Cyrillic, or non-ASCII Latin -letters—polyglot markup respects case sensitivity as it is called for. + attribute names, or attribute values in markup, script, or CSS. + Polyglot markup uses lower case letters for all ASCII letters. For + non-ASCII letters—such as Greek, Cyrillic, or non-ASCII Latin + letters—polyglot markup respects case sensitivity as it is called + for. </p> @@ -851,9 +933,12 @@ <h4><span class="secno">6.3.1 </span>Element Names</h4> <p>Polyglot markup uses the correct case for element names.</p> <ul> - <li>Polyglot markup uses lowercase letters for all HTML element names.</li> - <li>Polyglot markup uses lowercase letters for all MathML element names.</li> - <li>Polyglot markup uses lowercase letters for all SVG element names except the following, which + <li>Polyglot markup uses lowercase letters for all HTML element + names.</li> + <li>Polyglot markup uses lowercase letters for all MathML + element names.</li> + <li>Polyglot markup uses lowercase letters for all SVG + element names except the following, which <em title="must" class="rfc2119">must</em> be in mixed case: <ul> <li><code>altGlyph</code></li> @@ -903,11 +988,15 @@ <h4><span class="secno">6.3.2 </span>Attribute Names</h4> <p>Polyglot markup uses the correct case for attribute names.</p> <ul> - <li>Polyglot markup uses lowercase letters in attribute names for all HTML elements.</li> - <li>Polyglot markup uses lowercase letters in attribute names for all MathML elements except the lowercase - <code>definitionurl</code> <em title="must" class="rfc2119">must</em> be changed to the mixed case <code>definitionURL</code>.</li> - <li>Polyglot markup uses lowercase letters in attribute names for all SVG elements except the following, - which <em title="must" class="rfc2119">must</em> be in mixed case: + <li>Polyglot markup uses lowercase letters in attribute names + for all HTML elements.</li> + <li>Polyglot markup uses lowercase letters in attribute names + for all MathML elements except the lowercase + <code>definitionurl</code> <em title="must" class="rfc2119"> + must</em> be changed to the mixed case <code>definitionURL</code>.</li> + <li>Polyglot markup uses lowercase letters in attribute names + for all SVG elements except the following, which <em title="must" class="rfc2119"> + must</em> be in mixed case: <ul> <li><code>attributeName</code></li> <li><code>attributeType</code></li> @@ -981,24 +1070,26 @@ <h4><span class="secno">6.3.3 </span>Attribute Values</h4> <p> Polyglot markup uses lowercase letters for the values of the -attributes in the following list when they exist on HTML elements. - More specifically, where required, polyglot markup <em title="must" class="rfc2119">must</em> use lower case letters for all ASCII letters - in these attribute values; however, polyglot markup respects case sensitivity for non-ASCII letters such as - Greek, Cyrillic, or non-ASCII Latin letters. - For attribute values on HTML elements other than those in the following list, polyglot markup <em title="may" class="rfc2119">may</em> + attributes in the following list when they exist on HTML elements. + More specifically, where required, polyglot markup <em title="must" class="rfc2119"> + must</em> use lower case letters for all ASCII letters in these + attribute values; however, polyglot markup respects case sensitivity + for non-ASCII letters such as Greek, Cyrillic, or non-ASCII Latin + letters. For attribute values on HTML elements other than those in + the following list, polyglot markup <em title="may" class="rfc2119"> + may</em> use mixed case letters. </p> <p> Because XML is case sensitive, polyglot markup also requires case to -be consistent for values between markup, DOM APIs, and CSS. - In addition, polyglot markup respects the case sensitivity of all -other attribute values. - Although polyglot markup must always have lowercase values of the -attributes in the following list when they exist on HTML elements, - attributes not in this list and attributes on non-HTML elements may -have values made of mixed case letters. + be consistent for values between markup, DOM APIs, and CSS. In + addition, polyglot markup respects the case sensitivity of all other + attribute values. Although polyglot markup must always have + lowercase values of the attributes in the following list when they + exist on HTML elements, attributes not in this list and attributes + on non-HTML elements may have values made of mixed case letters. Note that other specifications, such as RDFa, may place additional -restrictions on the allowed values of certain attributes. + restrictions on the allowed values of certain attributes. </p> <ul> <li><code>accept</code></li> @@ -1055,7 +1146,8 @@ <div id="empty-elements" class="section"> <h3><span class="secno">6.4 </span>Empty Elements</h3> - <p>Polyglot markup uses only the elements in the following list as empty elements.</p> + <p>Polyglot markup uses only the elements in the following list as empty + elements.</p> <ul> <li><code>area</code></li> <li><code>base</code></li> @@ -1072,26 +1164,33 @@ <li><code>param</code></li> <li><code>source</code></li> </ul> - <p>Polyglot markup uses the minimized tag syntax for empty elements, e.g. <code><br/></code>. - The alternative syntax <code><br></br></code> allowed by XML gives uncertain results in many existing user agents. + <p>Polyglot markup uses the minimized tag syntax for empty elements, + e.g. <code><br/></code>. The alternative syntax <code><br></br></code> + allowed by XML gives uncertain results in many existing user agents. </p> <p> Given an empty instance of an element whose content model is not -EMPTY (for example, an empty title or paragraph) polyglot markup does - not use the minimized form (e.g. the document uses <code><p></p></code> and not <code><p /></code>). + EMPTY (for example, an empty title or paragraph) polyglot markup + does not use the minimized form (e.g. the document uses <code> + <p></p></code> and not <code><p /></code>). </p> - <p>Note that MathML and SVG elements may be either self-closing or contain content.</p> + <p>Note that MathML and SVG elements may be either self-closing or + contain content.</p> <!--End section: Empty Elements--> </div> <div id="elements-with-soecial-considerations" class="section"> <h3><span class="secno">6.5 </span>Elements with Special Considerations</h3> - <p>The following elements or their considerations require exceptions to the general rules for polyglot markup.</p> + <p>The following elements or their considerations require exceptions to + the general rules for polyglot markup.</p> <div id="white-space-in-textarea-and-pre" class="section"> - <h4><span class="secno">6.5.1 </span>White Space in <code><textarea></code> and <code><pre></code> Elements</h4> - Within polyglot markup, the text within either a <code><textarea></code> or <code><pre></code> element - <em title="must not" class="rfc2119">must not</em> begin with white space. + <h4><span class="secno">6.5.1 </span>White Space in <code><textarea></code> + and <code><pre></code> Elements</h4> + Within polyglot markup, the text within either a <code> + <textarea></code> or <code><pre></code> element + <em title="must not" class="rfc2119">must not</em> begin with + white space. <!--End section: White Space in textarea and pre Elements--> </div> @@ -1106,26 +1205,29 @@ <h2><span class="secno">7. </span>Attributes</h2> <p> Because of attribute-value normalization in XML [<cite><a href="#bib-XML10" rel="biblioentry" class="bibref">XML10</a></cite>], - polyglot markup does not contain tabs, line feeds, or carriage returns within CDATA attributes. + polyglot markup does not contain tabs, line feeds, or carriage returns + within CDATA attributes. </p> <p> Polyglot markup surrounds all attribute values with quotation marks. - Attribute values <em title="may" class="rfc2119">may</em> be surrounded either by single quotation marks or by double quotation marks. + Attribute values <em title="may" class="rfc2119">may</em> be surrounded + either by single quotation marks or by double quotation marks. </p> <p>See also <a href="#attribute-values">Attribute Values</a>.</p> <div id="disallowed-attributes" class="section"> <h3><span class="secno">7.1 </span>Disallowed Attributes</h3> - <p>The following attributes are not allowed in polyglot markup. - These attributes have effects in documents parsed as XML but do not have effects in documents parsed as text/html. - The HTML5 spec therefore defines them as invalid in text/html documents. - [<cite><a href="#bib-HTML5" rel="biblioentry" class="bibref">HTML5</a></cite>] + <p>The following attributes are not allowed in polyglot markup. These + attributes have effects in documents parsed as XML but do not have + effects in documents parsed as text/html. The HTML5 spec therefore + defines them as invalid in text/html documents. [<cite><a href="#bib-HTML5" rel="biblioentry" class="bibref">HTML5</a></cite>] </p> <ul> <li><code>xml:space</code></li> <li><code>xml:base</code></li> </ul> - <p> Note that the <code>xml:space</code> and <code>xml:base</code> attributes are allowed on SVG and MathML elements.</p> + <p> Note that the <code>xml:space</code> and <code>xml:base</code> + attributes are allowed on SVG and MathML elements.</p> <!--End section: Disallowed Attributes--> </div> @@ -1133,14 +1235,17 @@ <div id="language-attributes" class="section"> <h3><span class="secno">7.2 </span>Language Attributes</h3> <p> - When using language attributes, polyglot markup <em title="must" class="rfc2119">must</em> use both the - <code>lang</code> and <code>xml:lang</code> attributes. - Neither attribute is to be used without the other, and the values for both <code>lang</code> and <code>xml:lang</code> + When using language attributes, polyglot markup <em title="must" class="rfc2119"> + must</em> use both the + <code>lang</code> and <code>xml:lang</code> attributes. Neither + attribute is to be used without the other, and the values for both <code> + lang</code> and <code>xml:lang</code> <em title="must" class="rfc2119">must</em> be the same. </p> <p> - Polyglot markup <em title="should" class="rfc2119">should</em> use the language attributes in the <code>html</code> element - to set the default language for the document.</p> + Polyglot markup <em title="should" class="rfc2119">should</em> use + the language attributes in the <code>html</code> element to set the + default language for the document.</p> <!--End section: Language Attributes--> </div> @@ -1158,12 +1263,14 @@ <li><code>quot</code></li> </ul> <p> - For entities beyond the previous list, a polyglot document uses character references. - For example, polyglot markup uses <code>&#xA0;</code> instead of <code>&nbsp;</code>. - Note that polyglot markup may use decimal values for escape characters (such as &#160; in the previous example); - however, the <a href="http://www.w3.org/TR/2005/REC-charmod-20050215/#C048">Character Model for the World Wide Web</a> recommends that - content <em title="should" class="rfc2119">should</em> use the hexadecimal form of character escapes - rather than the decimal form when there are both. [<cite><a href="#bib-CHARMOD" rel="biblioentry" class="bibref">CHARMOD</a></cite>] + For entities beyond the previous list, a polyglot document uses + character references. For example, polyglot markup uses <code>&#xA0;</code> + instead of <code>&nbsp;</code>. Note that polyglot markup may use + decimal values for escape characters (such as &#160; in the previous + example); however, the <a href="http://www.w3.org/TR/2005/REC-charmod-20050215/#C048"> + Character Model for the World Wide Web</a> recommends that content <em title="should" class="rfc2119"> + should</em> use the hexadecimal form of character escapes rather than + the decimal form when there are both. [<cite><a href="#bib-CHARMOD" rel="biblioentry" class="bibref">CHARMOD</a></cite>] </p> <!--End section: Named Entity References--> @@ -1173,39 +1280,41 @@ <div id="script-and-style" class="section"> <h2><span class="secno">9. </span>Script and Style</h2> <p> - Script and style commands <em title="should" class="rfc2119">should</em> be included by linking to external files rather than including them in-line. - However, polyglot markup <em title="must not" class="rfc2119">must not</em> link to an external stylesheet by using the xml-stylesheet - processing instruction. - See also <a href="#PI-and-xml">Processing Instructions and the XML Declaration</a>. + Script and style commands <em title="should" class="rfc2119">should</em> + be included by linking to external files rather than including them + in-line. However, polyglot markup <em title="must not" class="rfc2119"> + must not</em> link to an external stylesheet by using the xml-stylesheet + processing instruction. See also <a href="#PI-and-xml">Processing + Instructions and the XML Declaration</a>. </p> <p> - The following examples show the proper way to include external script and style, respectively: + The following examples show the proper way to include external script + and style, respectively: </p> - <pre class="example"><script src="external.js"></script></pre> - <pre class="example"><link rel="stylesheet" href="external.css"/></pre> + <pre class="example"><script src="external.js"></script></pre> + <pre class="example"><link rel="stylesheet" href="external.css"/></pre> <p> - Although <code>document.write()</code> and <code>document.writeln()</code> are valid in an HTML document, neither function may be used in XHTML. - Therefore, neither is used in polyglot markup. - Instead, use the <code>innerHTML</code> property for both HTML and XHTML. - Note that the <code>innerHTML</code> property takes a string. - XML parsers parse the string as XML in XHTML. - HTML parsers parse the string as HTML in HTML. - Because of the difference in parsing, if you send the parser content -that does not follow the rules for polyglot markup the results will - differ for a DOM create with an XML parser and one created with an -HTML parser. + Although <code>document.write()</code> and <code>document.writeln()</code> + are valid in an HTML document, neither function may be used in XHTML. + Therefore, neither is used in polyglot markup. Instead, use the <code> + innerHTML</code> property for both HTML and XHTML. Note that the <code> + innerHTML</code> property takes a string. XML parsers parse the string + as XML in XHTML. HTML parsers parse the string as HTML in HTML. Because + of the difference in parsing, if you send the parser content that does + not follow the rules for polyglot markup the results will differ for a + DOM create with an XML parser and one created with an HTML parser. </p> <div id="external-script-and-style" class="section"> <h3><span class="secno">9.1 </span>External Script and Style</h3> <p> - Polyglot markup uses external scripts if that document's script or style sheet uses <code><</code> or <code>&</code> or <code>]]></code> - or <code>--</code>. - Note that XML parsers are permitted to silently remove the -contents of comments; therefore, the historical practice of hiding - scripts and style sheets within comments to make the documents -backward compatible is likely to not work as expected in XML-based user -agents. + Polyglot markup uses external scripts if that document's script or + style sheet uses <code><</code> or <code>&</code> or <code>]]></code> + or <code>--</code>. Note that XML parsers are permitted to silently + remove the contents of comments; therefore, the historical practice + of hiding scripts and style sheets within comments to make the + documents backward compatible is likely to not work as expected in + XML-based user agents. </p> <!--End section: External Script and Style--> @@ -1213,28 +1322,36 @@ <div id="in-line-script-and-style" class="section"> <h3><span class="secno">9.2 </span>In-line Script and Style</h3> - <p>If polyglot markup must use script or style commands within its source code, either use safe content or wrap the command in a - <code>CDATA</code> section. - However, polyglot markup does not use a <code>CDATA</code> section unless it is being used within foreign content. + <p>If polyglot markup must use script or style commands within its + source code, either use safe content or wrap the command in a + <code>CDATA</code> section. However, polyglot markup does not use a <code> + CDATA</code> section unless it is being used within foreign content. </p> <div id="safe-content" class="section"> <h4><span class="secno">9.2.1 </span>Safe Content</h4> <p> - Safe content is content that does not contain a <code><</code> or <code>&</code> character. - The following example is safe because it does not contain problematic characters within the <code><script></code> tag. + Safe content is content that does not contain a <code><</code> + or <code>&</code> character. The following example is safe + because it does not contain problematic characters within + the <code><script></code> tag. </p> - <pre class="example"><script>document.body.appendChild(document.createElement("div"));</script></pre> + <pre class="example"><script>document.body.appendChild(document.createElement("div"));</script></pre> <!--End section: Safe Content--> </div> <div id="wrapping-in-cdata" class="section"> - <h4><span class="secno">9.2.2 </span>Wrapping a Command in a CDATA Section</h4> + <h4><span class="secno">9.2.2 </span>Wrapping a Command in a CDATA + Section</h4> <p> - Note that you cannot achieve same DOM in both XHTML and HTML by using in-line commands in a CDATA section. - However, this is not usally a problem unless the code has a dependency on the exact number of text nodes under a <code><script></code> or <code><style></code> element. - The following examples show in-line script and style commands wrapped in a <code>CDATA</code> section. + Note that you cannot achieve same DOM in both XHTML and HTML + by using in-line commands in a CDATA section. However, this + is not usally a problem unless the code has a dependency on + the exact number of text nodes under a <code><script></code> + or <code><style></code> element. The following examples show + in-line script and style commands wrapped in a <code>CDATA</code> + section. </p> <pre class="example"><script> //<![CDATA[ @@ -1248,10 +1365,10 @@ </style></pre> <p> - When using MathML or SVG, the parser follows the XML parsing rules. - Polyglot markup does not rely on getting a CDATA instance from the -DOM when using MathML or SVG, because the HTML parser does not create a - CDATA instance in the DOM. + When using MathML or SVG, the parser follows the XML parsing + rules. Polyglot markup does not rely on getting a CDATA instance + from the DOM when using MathML or SVG, because the HTML parser + does not create a CDATA instance in the DOM. </p> <!--End section: Wrapping a Command in a CDATA Section--> @@ -1264,7 +1381,8 @@ </div> <div id="foreign-content" class="section"> -<h2><span class="secno">10. </span>Exceptions from the Foreign Content Parsing Rules</h2> +<h2><span class="secno">10. </span>Exceptions from the Foreign Content Parsing +Rules</h2> <p> <!-- TODO: Need to call out exceptions from the foreign content parsing rules (e.g. <foreignContent> --> </p> @@ -1276,10 +1394,9 @@ <h2><span class="secno">A. </span>Acknowledgements</h2> <p> Many thanks to 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. + 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> @@ -1290,25 +1407,31 @@ <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>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> + <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>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"> + 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-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). + <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>
Received on Thursday, 14 October 2010 17:53:56 UTC