xhtml1.xhtml 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453
  1. <?xml version="1.0"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "dtds/xhtml1-strict.dtd">
  3. <?xml-stylesheet href="W3C-PR.css" type="text/css"?>
  4. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  5. <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6. <title>XHTML 1.0: The Extensible HyperText Markup
  7. Language</title>
  8. <link rel="stylesheet" href="W3C-PR.css" type="text/css" />
  9. <style type="text/css">
  10. span.term { font-style: italic; color: rgb(0, 0, 192) }
  11. code {
  12. color: green;
  13. font-family: monospace;
  14. font-weight: bold;
  15. }
  16. code.greenmono {
  17. color: green;
  18. font-family: monospace;
  19. font-weight: bold;
  20. }
  21. .good {
  22. border: solid green;
  23. border-width: 2px;
  24. color: green;
  25. font-weight: bold;
  26. margin-right: 5%;
  27. margin-left: 0;
  28. }
  29. .bad {
  30. border: solid red;
  31. border-width: 2px;
  32. margin-left: 0;
  33. margin-right: 5%;
  34. color: rgb(192, 101, 101);
  35. }
  36. img {
  37. color: white;
  38. border: none;
  39. }
  40. div.navbar { text-align: center; }
  41. div.contents {
  42. background-color: rgb(204,204,255);
  43. padding: 0.5em;
  44. border: none;
  45. margin-right: 5%;
  46. }
  47. .tocline { list-style: none; }
  48. table.exceptions { background-color: rgb(255,255,153); }
  49. </style>
  50. </head>
  51. <body>
  52. <div class="navbar">
  53. <a href="#toc">table of contents</a>
  54. <hr />
  55. </div>
  56. <div class="head"><p><a href="http://www.w3.org/"><img class="head" src="w3c_home.gif" alt="W3C" /></a></p>
  57. <h1 class="head"><a name="title" id="title">XHTML</a><sup>&#x2122;</sup> 1.0:
  58. The Extensible HyperText Markup Language</h1>
  59. <h2>A Reformulation of HTML 4.0 in XML 1.0</h2>
  60. <h3>W3C Proposed Recommendation 10 December 1999</h3>
  61. <dl>
  62. <dt>This version:</dt>
  63. <dd><a href="http://www.w3.org/TR/1999/PR-xhtml1-19991210">
  64. http://www.w3.org/TR/1999/PR-xhtml1-19991210</a> <br />
  65. (<a href="xhtml1.ps">Postscript version</a>,
  66. <a href="xhtml1.pdf">PDF version</a>,
  67. <a href="xhtml1.zip">ZIP archive</a>, or
  68. <a href="xhtml1.tgz">Gzip'd TAR archive</a>)
  69. </dd>
  70. <dt>Latest version:</dt>
  71. <dd><a href="http://www.w3.org/TR/xhtml1">
  72. http://www.w3.org/TR/xhtml1</a></dd>
  73. <dt>Previous versions:</dt>
  74. <dd><a href="http://www.w3.org/TR/1999/WD-xhtml1-19991124">
  75. http://www.w3.org/TR/1999/WD-xhtml1-19991124</a></dd>
  76. <dd><a href="http://www.w3.org/TR/1999/PR-xhtml1-19990824">
  77. http://www.w3.org/TR/1999/PR-xhtml1-19990824</a></dd>
  78. <dt>Authors:</dt>
  79. <dd>See <a href="#acks">acknowledgements</a>.</dd>
  80. </dl>
  81. <p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">
  82. Copyright</a> &copy; 1999 <a href="http://www.w3.org/">W3C</a><sup>&reg;</sup>
  83. (<a href="http://www.lcs.mit.edu/">MIT</a>, <a href="http://www.inria.fr/">INRIA</a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">
  84. liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">
  85. trademark</a>, <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document
  86. use</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-software">software
  87. licensing</a> rules apply.</p>
  88. <hr />
  89. </div>
  90. <h2 class="notoc">Abstract</h2>
  91. <p>This specification defines <abbr title="Extensible Hypertext Markup Language">XHTML</abbr> 1.0, a reformulation of HTML
  92. 4.0 as an XML 1.0 application, and three <abbr title="Document Type Definition">DTDs</abbr> corresponding to
  93. the ones defined by HTML 4.0. The semantics of the elements and
  94. their attributes are defined in the W3C Recommendation for HTML
  95. 4.0. These semantics provide the foundation for future
  96. extensibility of XHTML. Compatibility with existing HTML user
  97. agents is possible by following a small set of guidelines.</p>
  98. <h2>Status of this document</h2>
  99. <p><em>This section describes the status of this document at the time
  100. of its publication. Other documents may supersede this document. The
  101. latest status of this document series is maintained at the W3C.</em></p>
  102. <p>This specification is a Proposed Recommendation of the HTML Working Group. It is
  103. a revision of the Proposed Recommendation dated <a href="http://www.w3.org/TR/1999/PR-xhtml1-19990824/">24 August
  104. 1999</a> incorporating changes as a result of comments from the Proposed
  105. Recommendation review, and
  106. comments and further deliberations of the W3C HTML Working Group. A
  107. <a href="xhtml1-diff-19991210.html">diff-marked version</a> from the previous
  108. proposed recommendation is available for comparison purposes.</p>
  109. <p>On 10 December 1999, this document enters a
  110. <a href="http://www.w3.org/Consortium/Process/#RecsPR">
  111. Proposed Recommendation</a> review period. From that date until 8 January
  112. 2000,
  113. W3C Advisory Committee representatives are encouraged
  114. to review this specification and return comments in their completed
  115. ballots to w3c-html-review@w3.org. Please send any comments of a
  116. confidential nature in separate email to w3t-html@w3.org, which is
  117. visible to the Team only.</p>
  118. <p>No sooner than 14 days after the end of the review period, the
  119. Director will announce the document's disposition: it may become a W3C
  120. Recommendation (possibly with minor changes), it may revert to Working
  121. Draft status, or it may be dropped as a W3C work item.</p>
  122. <p>Publication as a Proposed Recommendation does not imply endorsement
  123. by the W3C membership. This is still a draft document and may be
  124. updated, replaced or obsoleted by other documents at any time. It is
  125. inappropriate to cite W3C Proposed Recommendation as other than "work
  126. in progress."</p>
  127. <p>This document has been produced as part of the <a href="http://www.w3.org/MarkUp/">W3C HTML Activity</a>. The goals of
  128. the <a href="http://www.w3.org/MarkUp/Group/">HTML Working
  129. Group</a> <i>(<a href="http://cgi.w3.org/MemberAccess/">members
  130. only</a>)</i> are discussed in the <a href="http://www.w3.org/MarkUp/Group/HTMLcharter">HTML Working Group
  131. charter</a> <i>(<a href="http://cgi.w3.org/MemberAccess/">members
  132. only</a>)</i>.</p>
  133. <p>A list of current W3C Recommendations and other technical documents
  134. can be found at <a href="http://www.w3.org/TR">http://www.w3.org/TR</a>.</p>
  135. <p>Public discussion on <abbr title="HyperText Markup Language">HTML</abbr> features takes place on the mailing list <a href="mailto:www-html@w3.org"> www-html@w3.org</a> (<a href="http://lists.w3.org/Archives/Public/www-html/">archive</a>). The W3C
  136. staff contact for work on HTML is <a href="mailto:dsr@w3.org">Dave
  137. Raggett</a>.</p>
  138. <p>Please report errors in this document to <a href="mailto:www-html-editor@w3.org">www-html-editor@w3.org</a>.</p>
  139. <p>The list of known errors in this specification is available at <a href="http://www.w3.org/1999/12/PR-xhtml1-19991210-errata">http://www.w3.org/1999/12/PR-xhtml1-19991210-errata</a>.</p>
  140. <h2 class="notoc"><a id="toc" name="toc">Contents</a></h2>
  141. <div class="contents">
  142. <ul class="toc">
  143. <li class="tocline">1. <a href="#xhtml">What is XHTML?</a>
  144. <ul class="toc">
  145. <li class="tocline">1.1 <a href="#html4">What is HTML 4.0?</a></li>
  146. <li class="tocline">1.2 <a href="#xml">What is XML?</a></li>
  147. <li class="tocline">1.3 <a href="#why">Why the need for XHTML?</a></li>
  148. </ul>
  149. </li>
  150. <li class="tocline">2. <a href="#defs">Definitions</a>
  151. <ul class="toc">
  152. <li class="tocline">2.1 <a href="#terms">Terminology</a></li>
  153. <li class="tocline">2.2 <a href="#general">General Terms</a></li>
  154. </ul>
  155. </li>
  156. <li class="tocline">3. <a href="#normative">Normative Definition of XHTML 1.0</a>
  157. <ul class="toc">
  158. <li class="tocline">3.1 <a href="#docconf">Document Conformance</a></li>
  159. <li class="tocline">3.2 <a href="#uaconf">User Agent Conformance</a></li>
  160. </ul>
  161. </li>
  162. <li class="tocline">4. <a href="#diffs">Differences with HTML 4.0</a>
  163. </li>
  164. <li class="tocline">5. <a href="#issues">Compatibility Issues</a>
  165. <ul class="toc">
  166. <li class="tocline">5.1 <a href="#media">Internet Media Types</a></li>
  167. </ul>
  168. </li>
  169. <li class="tocline">6. <a href="#future">Future Directions</a>
  170. <ul class="toc">
  171. <li class="tocline">6.1 <a href="#mods">Modularizing HTML</a></li>
  172. <li class="tocline">6.2 <a href="#extensions">Subsets and Extensibility</a></li>
  173. <li class="tocline">6.3 <a href="#profiles">Document Profiles</a></li>
  174. </ul>
  175. </li>
  176. <li class="tocline"><a href="#dtds">Appendix A. DTDs</a></li>
  177. <li class="tocline"><a href="#prohibitions">Appendix B. Element
  178. Prohibitions</a></li>
  179. <li class="tocline"><a href="#guidelines">Appendix C. HTML Compatibility Guidelines</a></li>
  180. <li class="tocline"><a href="#acks">Appendix D. Acknowledgements</a></li>
  181. <li class="tocline"><a href="#refs">Appendix E. References</a></li>
  182. </ul>
  183. </div>
  184. <!--OddPage-->
  185. <h1><a name="xhtml" id="xhtml">1. What is XHTML?</a></h1>
  186. <p>XHTML is a family of current and future document types and modules that
  187. reproduce, subset, and extend HTML 4.0 <a href="#ref-html4">[HTML]</a>. XHTML family document types are <abbr title="Extensible Markup Language">XML</abbr> based,
  188. and ultimately are designed to work in conjunction with XML-based user agents.
  189. The details of this family and its evolution are
  190. discussed in more detail in the section on <a href="#future">Future
  191. Directions</a>. </p>
  192. <p>XHTML 1.0 (this specification) is the first document type in the XHTML
  193. family. It is a reformulation of the three HTML 4.0 document types as
  194. applications of XML 1.0 <a href="#ref-xml"> [XML]</a>. It is intended
  195. to be used as a language for content that is both XML-conforming and, if some
  196. simple <a href="#guidelines">guidelines</a> are followed,
  197. operates in HTML 4.0 conforming user agents. Developers who migrate
  198. their content to XHTML 1.0 will realize the following benefits:</p>
  199. <ul>
  200. <li>XHTML documents are XML conforming. As such, they are readily viewed,
  201. edited, and validated with standard XML tools.</li>
  202. <li>XHTML documents can be written to
  203. to operate as well or better than they did before in existing
  204. HTML 4.0-conforming user agents as well as in new, XHTML 1.0 conforming user
  205. agents.</li>
  206. <li>XHTML documents can utilize applications (e.g. scripts and applets) that rely
  207. upon either the HTML Document Object Model or the XML Document Object Model <a href="#ref-dom">[DOM]</a>.</li>
  208. <li>As the XHTML family evolves, documents conforming to XHTML 1.0 will be more
  209. likely to interoperate within and among various XHTML environments.</li>
  210. </ul>
  211. <p>The XHTML family is the next step in the evolution of the Internet. By
  212. migrating to XHTML today, content developers can enter the XML world with all
  213. of its attendant benefits, while still remaining confident in their
  214. content's backward and future compatibility.</p>
  215. <h2><a name="html4" id="html4">1.1 What is HTML 4.0?</a></h2>
  216. <p>HTML 4.0 <a href="#ref-html4">[HTML]</a> is an <abbr title="Standard Generalized Markup Language">SGML</abbr> (Standard
  217. Generalized Markup Language) application conforming to
  218. International Standard <abbr title="Organization for International Standardization">ISO</abbr> 8879, and is widely regarded as the
  219. standard publishing language of the World Wide Web.</p>
  220. <p>SGML is a language for describing markup languages,
  221. particularly those used in electronic document exchange, document
  222. management, and document publishing. HTML is an example of a
  223. language defined in SGML.</p>
  224. <p>SGML has been around since the middle 1980's and has remained
  225. quite stable. Much of this stability stems from the fact that the
  226. language is both feature-rich and flexible. This flexibility,
  227. however, comes at a price, and that price is a level of
  228. complexity that has inhibited its adoption in a diversity of
  229. environments, including the World Wide Web.</p>
  230. <p>HTML, as originally conceived, was to be a language for the
  231. exchange of scientific and other technical documents, suitable
  232. for use by non-document specialists. HTML addressed the problem
  233. of SGML complexity by specifying a small set of structural and
  234. semantic tags suitable for authoring relatively simple documents.
  235. In addition to simplifying the document structure, HTML added
  236. support for hypertext. Multimedia capabilities were added
  237. later.</p>
  238. <p>In a remarkably short space of time, HTML became wildly
  239. popular and rapidly outgrew its original purpose. Since HTML's
  240. inception, there has been rapid invention of new elements for use
  241. within HTML (as a standard) and for adapting HTML to vertical,
  242. highly specialized, markets. This plethora of new elements has
  243. led to compatibility problems for documents across different
  244. platforms.</p>
  245. <p>As the heterogeneity of both software and platforms rapidly
  246. proliferate, it is clear that the suitability of 'classic' HTML
  247. 4.0 for use on these platforms is somewhat limited.</p>
  248. <h2><a name="xml" id="xml">1.2 What is XML?</a></h2>
  249. <p>XML<sup>&#x2122;</sup> is the shorthand for Extensible Markup
  250. Language, and is an acronym of Extensible Markup Language <a href="#ref-xml">[XML]</a>.</p>
  251. <p>XML was conceived as a means of regaining the power and
  252. flexibility of SGML without most of its complexity. Although a
  253. restricted form of SGML, XML nonetheless preserves most of SGML's
  254. power and richness, and yet still retains all of SGML's commonly
  255. used features.</p>
  256. <p>While retaining these beneficial features, XML removes many of
  257. the more complex features of SGML that make the authoring and
  258. design of suitable software both difficult and costly.</p>
  259. <h2><a name="why" id="why">1.3 Why the need for XHTML?</a></h2>
  260. <p>The benefits of migrating to XHTML 1.0 are described above. Some of the
  261. benefits of migrating to XHTML in general are:</p>
  262. <ul>
  263. <li>Document developers and user agent designers are constantly
  264. discovering new ways to express their ideas through new markup. In XML, it is
  265. relatively easy to introduce new elements or additional element
  266. attributes. The XHTML family is designed to accommodate these extensions
  267. through XHTML modules and techniques for developing new XHTML-conforming
  268. modules (described in the forthcoming XHTML Modularization specification).
  269. These modules will permit the combination of existing and
  270. new feature sets when developing content and when designing new user
  271. agents.</li>
  272. <li>Alternate ways of accessing the Internet are constantly being
  273. introduced. Some estimates indicate that by the year 2002, 75% of
  274. Internet document viewing will be carried out on these alternate
  275. platforms. The XHTML family is designed with general user agent
  276. interoperability in mind. Through a new user agent and document profiling
  277. mechanism, servers, proxies, and user agents will be able to perform
  278. best effort content transformation. Ultimately, it will be possible to
  279. develop XHTML-conforming content that is usable by any XHTML-conforming
  280. user agent.</li>
  281. </ul>
  282. <!--OddPage-->
  283. <h1><a name="defs" id="defs">2. Definitions</a></h1>
  284. <h2><a name="terms" id="terms">2.1 Terminology</a></h2>
  285. <p>The following terms are used in this specification. These
  286. terms extend the definitions in <a href="#ref-rfc2119">
  287. [RFC2119]</a> in ways based upon similar definitions in ISO/<abbr title="International Electro-technical Commission">IEC</abbr>
  288. 9945-1:1990 <a href="#ref-posix">[POSIX.1]</a>:</p>
  289. <dl>
  290. <dt>Implementation-defined</dt>
  291. <dd>A value or behavior is implementation-defined when it is left
  292. to the implementation to define [and document] the corresponding
  293. requirements for correct document construction.</dd>
  294. <dt>May</dt>
  295. <dd>With respect to implementations, the word "may" is to be
  296. interpreted as an optional feature that is not required in this
  297. specification but can be provided. With respect to <a href="#docconf">Document Conformance</a>, the word "may" means that
  298. the optional feature must not be used. The term "optional" has
  299. the same definition as "may".</dd>
  300. <dt>Must</dt>
  301. <dd>In this specification, the word "must" is to be interpreted
  302. as a mandatory requirement on the implementation or on Strictly
  303. Conforming XHTML Documents, depending upon the context. The term
  304. "shall" has the same definition as "must".</dd>
  305. <dt>Reserved</dt>
  306. <dd>A value or behavior is unspecified, but it is not allowed to
  307. be used by Conforming Documents nor to be supported by a
  308. Conforming User Agents.</dd>
  309. <dt>Should</dt>
  310. <dd>With respect to implementations, the word "should" is to be
  311. interpreted as an implementation recommendation, but not a
  312. requirement. With respect to documents, the word "should" is to
  313. be interpreted as recommended programming practice for documents
  314. and a requirement for Strictly Conforming XHTML Documents.</dd>
  315. <dt>Supported</dt>
  316. <dd>Certain facilities in this specification are optional. If a
  317. facility is supported, it behaves as specified by this
  318. specification.</dd>
  319. <dt>Unspecified</dt>
  320. <dd>When a value or behavior is unspecified, the specification
  321. defines no portability requirements for a facility on an
  322. implementation even when faced with a document that uses the
  323. facility. A document that requires specific behavior in such an
  324. instance, rather than tolerating any behavior when using that
  325. facility, is not a Strictly Conforming XHTML Document.</dd>
  326. </dl>
  327. <h2><a name="general" id="general">2.2 General Terms</a></h2>
  328. <dl>
  329. <dt>Attribute</dt>
  330. <dd>An attribute is a parameter to an element declared in the
  331. DTD. An attribute's type and value range, including a possible
  332. default value, are defined in the DTD.</dd>
  333. <dt>DTD</dt>
  334. <dd>A DTD, or document type definition, is a collection of XML
  335. declarations that, as a collection, defines the legal structure,
  336. <span class="term">elements</span>, and <span class="term">
  337. attributes</span> that are available for use in a document that
  338. complies to the DTD.</dd>
  339. <dt>Document</dt>
  340. <dd>A document is a stream of data that, after being combined
  341. with any other streams it references, is structured such that it
  342. holds information contained within <span class="term">
  343. elements</span> that are organized as defined in the associated
  344. <span class="term">DTD</span>. See <a href="#docconf">Document
  345. Conformance</a> for more information.</dd>
  346. <dt>Element</dt>
  347. <dd>An element is a document structuring unit declared in the
  348. <span class="term">DTD</span>. The element's content model is
  349. defined in the <span class="term">DTD</span>, and additional
  350. semantics may be defined in the prose description of the
  351. element.</dd>
  352. <dt><a name="facilities" id="facilities">Facilities</a></dt>
  353. <dd>Functionality includes <span class="term">elements</span>,
  354. <span class="term">attributes</span>, and the semantics
  355. associated with those <span class="term">elements</span> and
  356. <span class="term">attributes</span>. An implementation
  357. supporting that functionality is said to provide the necessary
  358. facilities.</dd>
  359. <dt>Implementation</dt>
  360. <dd>An implementation is a system that provides collection of
  361. <span class="term">facilities</span> and services that supports
  362. this specification. See <a href="#uaconf">User Agent
  363. Conformance</a> for more information.</dd>
  364. <dt>Parsing</dt>
  365. <dd>Parsing is the act whereby a <span class="term">
  366. document</span> is scanned, and the information contained within
  367. the <span class="term">document</span> is filtered into the
  368. context of the <span class="term">elements</span> in which the
  369. information is structured.</dd>
  370. <dt>Rendering</dt>
  371. <dd>Rendering is the act whereby the information in a <span class="term">document</span> is presented. This presentation is
  372. done in the form most appropriate to the environment (e.g.
  373. aurally, visually, in print).</dd>
  374. <dt>User Agent</dt>
  375. <dd>A user agent is an <span class="term">implementation</span>
  376. that retrieves and processes XHTML documents. See <a href="#uaconf">User Agent Conformance</a> for more information.</dd>
  377. <dt>Validation</dt>
  378. <dd>Validation is a process whereby <span class="term">
  379. documents</span> are verified against the associated <span class="term">DTD</span>, ensuring that the structure, use of <span class="term">elements</span>, and use of <span class="term">
  380. attributes</span> are consistent with the definitions in the
  381. <span class="term">DTD</span>.</dd>
  382. <dt><a name="wellformed" id="wellformed">Well-formed</a></dt>
  383. <dd>A <span class="term">document</span> is well-formed when it
  384. is structured according to the rules defined in <a href="http://www.w3.org/TR/REC-xml#sec-well-formed">Section 2.1</a> of
  385. the XML 1.0 Recommendation <a href="#ref-xml">[XML]</a>.
  386. Basically, this definition states that elements, delimited by
  387. their start and end tags, are nested properly within one
  388. another.</dd>
  389. </dl>
  390. <!--OddPage-->
  391. <h1><a name="normative" id="normative">3. Normative Definition of
  392. XHTML 1.0</a></h1>
  393. <h2><a name="docconf" id="docconf">3.1 Document
  394. Conformance</a></h2>
  395. <p>This version of XHTML provides a definition of strictly
  396. conforming XHTML documents, which are restricted to tags and
  397. attributes from the XHTML namespace. See <a href="#well-formed">Section 3.1.2</a> for information on using XHTML
  398. with other namespaces, for instance, to include metadata
  399. expressed in <abbr title="Resource Description Format">RDF</abbr> within XHTML documents.</p>
  400. <h3><a name="strict" id="strict">3.1.1 Strictly Conforming
  401. Documents</a></h3>
  402. <p>A Strictly Conforming XHTML Document is a document that
  403. requires only the facilities described as mandatory in this
  404. specification. Such a document must meet all of the following
  405. criteria:</p>
  406. <ol>
  407. <li>
  408. <p>It must validate against one of the three DTDs found in <a href="#dtds">Appendix&#xA0;A</a>.</p>
  409. </li>
  410. <li>
  411. <p>The root element of the document must be <code>
  412. &lt;html&gt;</code>.</p>
  413. </li>
  414. <li>
  415. <p>The root element of the document must designate the XHTML
  416. namespace using the <code>xmlns</code> attribute <a href="#ref-xmlns">[XMLNAMES]</a>. The namespace for XHTML is
  417. defined to be
  418. <code>http://www.w3.org/1999/xhtml</code>.</p>
  419. </li>
  420. <li>
  421. <p>There must be a DOCTYPE declaration in the document prior to
  422. the root element. The public identifier included in
  423. the DOCTYPE declaration must reference one of the three DTDs
  424. found in <a href="#dtds">Appendix&#xA0;A</a> using the respective
  425. Formal Public Identifier. The system identifier may be changed to reflect
  426. local system conventions.</p>
  427. <pre>
  428. &lt;!DOCTYPE html
  429. PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  430. "http://www.w3.org/TR/1999/PR-xhtml1-19991210/DTD/xhtml1-strict.dtd&gt;
  431. &lt;!DOCTYPE html
  432. PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  433. "http://www.w3.org/TR/1999/PR-xhtml1-19991210/DTD/xhtml1-transitional.dtd&gt;
  434. &lt;!DOCTYPE html
  435. PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
  436. "http://www.w3.org/TR/1999/PR-xhtml1-19991210/DTD/xhtml1-frameset.dtd&gt;
  437. </pre>
  438. </li>
  439. </ol>
  440. <p>Here is an example of a minimal XHTML document.</p>
  441. <div class="good">
  442. <pre>
  443. &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  444. &lt;!DOCTYPE html
  445. PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  446. "http://www.w3.org/TR/1999/PR-xhtml1-19991210/DTD/xhtml1-strict.dtd"&gt;
  447. &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
  448. &lt;head&gt;
  449. &lt;title&gt;Virtual Library&lt;/title&gt;
  450. &lt;/head&gt;
  451. &lt;body&gt;
  452. &lt;p&gt;Moved to &lt;a href="http://vlib.org/"&gt;vlib.org&lt;/a&gt;.&lt;/p&gt;
  453. &lt;/body&gt;
  454. &lt;/html&gt;</pre>
  455. </div>
  456. <p>Note that in this example, the XML declaration is included. An XML
  457. declaration like the one above is
  458. not required in all XML documents. XHTML document authors are strongly encouraged to use XML declarations in all their documents. Such a declaration is required
  459. when the character encoding of the document is other than the default UTF-8 or
  460. UTF-16.</p>
  461. <h3><a name="well-formed" id="well-formed">3.1.2 Using XHTML with
  462. other namespaces</a></h3>
  463. <p>The XHTML namespace may be used with other XML namespaces
  464. as per <a href="#ref-xmlns">[XMLNAMES]</a>, although such
  465. documents are not strictly conforming XHTML 1.0 documents as
  466. defined above. Future work by W3C will address ways to specify
  467. conformance for documents involving multiple namespaces.</p>
  468. <p>The following example shows the way in which XHTML 1.0 could
  469. be used in conjunction with the MathML Recommendation:</p>
  470. <div class="good">
  471. <pre>
  472. &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
  473. &lt;head&gt;
  474. &lt;title&gt;A Math Example&lt;/title&gt;
  475. &lt;/head&gt;
  476. &lt;body&gt;
  477. &lt;p&gt;The following is MathML markup:&lt;/p&gt;
  478. &lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;
  479. &lt;apply&gt; &lt;log/&gt;
  480. &lt;logbase&gt;
  481. &lt;cn&gt; 3 &lt;/cn&gt;
  482. &lt;/logbase&gt;
  483. &lt;ci&gt; x &lt;/ci&gt;
  484. &lt;/apply&gt;
  485. &lt;/math&gt;
  486. &lt;/body&gt;
  487. &lt;/html&gt;
  488. </pre>
  489. </div>
  490. <p>The following example shows the way in which XHTML 1.0 markup
  491. could be incorporated into another XML namespace:</p>
  492. <div class="good">
  493. <pre>
  494. &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  495. &lt;!-- initially, the default namespace is "books" --&gt;
  496. &lt;book xmlns='urn:loc.gov:books'
  497. xmlns:isbn='urn:ISBN:0-395-36341-6' xml:lang="en" lang="en"&gt;
  498. &lt;title&gt;Cheaper by the Dozen&lt;/title&gt;
  499. &lt;isbn:number&gt;1568491379&lt;/isbn:number&gt;
  500. &lt;notes&gt;
  501. &lt;!-- make HTML the default namespace for a hypertext commentary --&gt;
  502. &lt;p xmlns='http://www.w3.org/1999/xhtml'&gt;
  503. This is also available &lt;a href="http://www.w3.org/"&gt;online&lt;/a&gt;.
  504. &lt;/p&gt;
  505. &lt;/notes&gt;
  506. &lt;/book&gt;
  507. </pre>
  508. </div>
  509. <h2><a name="uaconf" id="uaconf">3.2 User Agent
  510. Conformance</a></h2>
  511. <p>A conforming user agent must meet all of the following
  512. criteria:</p>
  513. <ol>
  514. <li>In order to be consistent with the XML 1.0 Recommendation <a href="#ref-xml">[XML]</a>, the user agent must parse and evaluate
  515. an XHTML document for well-formedness. If the user agent claims
  516. to be a validating user agent, it must also validate documents
  517. against their referenced DTDs according to <a href="#ref-xml">
  518. [XML]</a>.</li>
  519. <li>When the user agent claims to support <a href="#facilities">
  520. facilities</a> defined within this specification or required by
  521. this specification through normative reference, it must do so in
  522. ways consistent with the facilities' definition.</li>
  523. <li>When a user agent processes an XHTML document as generic XML,
  524. it shall only recognize attributes of type
  525. <code>ID</code> (e.g. the <code>id</code> attribute on most XHTML elements)
  526. as fragment identifiers.</li>
  527. <li>If a user agent encounters an element it does not recognize,
  528. it must render the element's content.</li>
  529. <li>If a user agent encounters an attribute it does not
  530. recognize, it must ignore the entire attribute specification
  531. (i.e., the attribute and its value).</li>
  532. <li>If a user agent encounters an attribute value it doesn't
  533. recognize, it must use the default attribute value.</li>
  534. <li>If it encounters an entity reference (other than one
  535. of the predefined entities) for which the User Agent has
  536. processed no declaration (which could happen if the declaration
  537. is in the external subset which the User Agent hasn't read), the entity
  538. reference should be rendered as the characters (starting
  539. with the ampersand and ending with the semi-colon) that
  540. make up the entity reference.</li>
  541. <li>When rendering content, User Agents that encounter
  542. characters or character entity references that are recognized but not renderable should display the document in such a way that it is obvious to the user that normal rendering has not taken place.</li>
  543. <li>
  544. The following characters are defined in [XML] as whitespace characters:
  545. <ul>
  546. <li>Space (&amp;#x0020;)</li>
  547. <li>Tab (&amp;#x0009;)</li>
  548. <li>Carriage return (&amp;#x000D;)</li>
  549. <li>Line feed (&amp;#x000A;)</li>
  550. </ul>
  551. <p>
  552. The XML processor normalizes different system's line end codes into one
  553. single line-feed character, that is passed up to the application. The XHTML
  554. user agent in addition, must treat the following characters as whitespace:
  555. </p>
  556. <ul>
  557. <li>Form feed (&amp;#x000C;)</li>
  558. <li>Zero-width space (&amp;#x200B;)</li>
  559. </ul>
  560. <p>
  561. In elements where the 'xml:space' attribute is set to 'preserve', the user
  562. agent must leave all whitespace characters intact (with the exception of
  563. leading and trailing whitespace characters, which should be removed).
  564. Otherwise, whitespace
  565. is handled according to the following rules:
  566. </p>
  567. <ul>
  568. <li>
  569. All whitespace surrounding block elements should be removed.
  570. </li>
  571. <li>
  572. Comments are removed entirely and do not affect whitespace handling. One
  573. whitespace character on either side of a comment is treated as two white
  574. space characters.
  575. </li>
  576. <li>
  577. Leading and trailing whitespace inside a block element must be removed.
  578. </li>
  579. <li>Line feed characters within a block element must be converted into a
  580. space (except when the 'xml:space' attribute is set to 'preserve').
  581. </li>
  582. <li>
  583. A sequence of white space characters must be reduced to a single space
  584. character (except when the 'xml:space' attribute is set to 'preserve').
  585. </li>
  586. <li>
  587. With regard to rendition,
  588. the User Agent should render the content in a
  589. manner appropriate to the language in which the content is written.
  590. In languages whose primary script is Latinate, the ASCII space
  591. character is typically used to encode both grammatical word boundaries and
  592. typographic whitespace; in languages whose script is related to Nagari
  593. (e.g., Sanskrit, Thai, etc.), grammatical boundaries may be encoded using
  594. the ZW 'space' character, but will not typically be represented by
  595. typographic whitespace in rendered output; languages using Arabiform scripts
  596. may encode typographic whitespace using a space character, but may also use
  597. the ZW space character to delimit 'internal' grammatical boundaries (what
  598. look like words in Arabic to an English eye frequently encode several words,
  599. e.g. 'kitAbuhum' = 'kitAbu-hum' = 'book them' == their book); and languages
  600. in the Chinese script tradition typically neither encode such delimiters nor
  601. use typographic whitespace in this way.
  602. </li>
  603. </ul>
  604. <p>Whitespace in attribute values is processed according to <a href="#ref-xml">[XML]</a>.</p>
  605. </li>
  606. </ol>
  607. <!--OddPage-->
  608. <h1><a name="diffs" id="diffs">4. Differences with HTML
  609. 4.0</a></h1>
  610. <p>Due to the fact that XHTML is an XML application, certain
  611. practices that were perfectly legal in SGML-based HTML 4.0 <a href="#ref-html4">[HTML]</a> must be changed.</p>
  612. <h2><a name="h-4.1" id="h-4.1">4.1 Documents must be
  613. well-formed</a></h2>
  614. <p><a href="#wellformed">Well-formedness</a> is a new concept
  615. introduced by <a href="#ref-xml">[XML]</a>. Essentially this
  616. means that all elements must either have closing tags or be
  617. written in a special form (as described below), and that all the
  618. elements must nest.</p>
  619. <p>Although overlapping is illegal in SGML, it was widely
  620. tolerated in existing browsers.</p>
  621. <div class="good">
  622. <p><strong><em>CORRECT: nested elements.</em></strong></p>
  623. <p>&lt;p&gt;here is an emphasized
  624. &lt;em&gt;paragraph&lt;/em&gt;.&lt;/p&gt;</p>
  625. </div>
  626. <div class="bad">
  627. <p><strong><em>INCORRECT: overlapping elements</em></strong></p>
  628. <p>&lt;p&gt;here is an emphasized
  629. &lt;em&gt;paragraph.&lt;/p&gt;&lt;/em&gt;</p>
  630. </div>
  631. <h2><a name="h-4.2" id="h-4.2">4.2 Element and attribute
  632. names must be in lower case</a></h2>
  633. <p>XHTML documents must use lower case for all HTML element and
  634. attribute names. This difference is necessary because XML is
  635. case-sensitive e.g. &lt;li&gt; and &lt;LI&gt; are different
  636. tags.</p>
  637. <h2><a name="h-4.3" id="h-4.3">4.3 For non-empty elements,
  638. end tags are required</a></h2>
  639. <p>In SGML-based HTML 4.0 certain elements were permitted to omit
  640. the end tag; with the elements that followed implying closure.
  641. This omission is not permitted in XML-based XHTML. All elements
  642. other than those declared in the DTD as <code>EMPTY</code> must
  643. have an end tag.</p>
  644. <div class="good">
  645. <p><strong><em>CORRECT: terminated elements</em></strong></p>
  646. <p>&lt;p&gt;here is a paragraph.&lt;/p&gt;&lt;p&gt;here is
  647. another paragraph.&lt;/p&gt;</p>
  648. </div>
  649. <div class="bad">
  650. <p><strong><em>INCORRECT: unterminated elements</em></strong></p>
  651. <p>&lt;p&gt;here is a paragraph.&lt;p&gt;here is another
  652. paragraph.</p>
  653. </div>
  654. <h2><a name="h-4.4" id="h-4.4">4.4 Attribute values must
  655. always be quoted</a></h2>
  656. <p>All attribute values must be quoted, even those which appear
  657. to be numeric.</p>
  658. <div class="good">
  659. <p><strong><em>CORRECT: quoted attribute values</em></strong></p>
  660. <p>&lt;table rows="3"&gt;</p>
  661. </div>
  662. <div class="bad">
  663. <p><strong><em>INCORRECT: unquoted attribute values</em></strong></p>
  664. <p>&lt;table rows=3&gt;</p>
  665. </div>
  666. <h2><a name="h-4.5" id="h-4.5">4.5 Attribute
  667. Minimization</a></h2>
  668. <p>XML does not support attribute minimization. Attribute-value
  669. pairs must be written in full. Attribute names such as <code>
  670. compact</code> and <code>checked</code> cannot occur in elements
  671. without their value being specified.</p>
  672. <div class="good">
  673. <p><strong><em>CORRECT: unminimized attributes</em></strong></p>
  674. <p>&lt;dl compact="compact"&gt;</p>
  675. </div>
  676. <div class="bad">
  677. <p><strong><em>INCORRECT: minimized attributes</em></strong></p>
  678. <p>&lt;dl compact&gt;</p>
  679. </div>
  680. <h2><a name="h-4.6" id="h-4.6">4.6 Empty Elements</a></h2>
  681. <p>Empty elements must either have an end tag or the start tag must end with <code>/&gt;</code>. For instance,
  682. <code>&lt;br/&gt;</code> or <code>&lt;hr&gt;&lt;/hr&gt;</code>. See <a href="#guidelines">HTML Compatibility Guidelines</a> for information on ways to
  683. ensure this is backward compatible with HTML 4.0 user agents.</p>
  684. <div class="good">
  685. <p><strong><em>CORRECT: terminated empty tags</em></strong></p>
  686. <p>&lt;br/&gt;&lt;hr/&gt;</p>
  687. </div>
  688. <div class="bad">
  689. <p><strong><em>INCORRECT: unterminated empty tags</em></strong></p>
  690. <p>&lt;br&gt;&lt;hr&gt;</p>
  691. </div>
  692. <h2><a name="h-4.7" id="h-4.7">4.7 Whitespace handling in
  693. attribute values</a></h2>
  694. <p>In attribute values, user agents will strip leading and
  695. trailing whitespace from attribute values and map sequences
  696. of one or more whitespace characters (including line breaks) to
  697. a single inter-word space (an ASCII space character for western
  698. scripts). See <a href="http://www.w3.org/TR/REC-xml#AVNormalize">
  699. Section 3.3.3</a> of <a href="#ref-xml">[XML]</a>.</p>
  700. <h2><a name="h-4.8" id="h-4.8">4.8 Script and Style
  701. elements</a></h2>
  702. <p>In XHTML, the script and style elements are declared as having
  703. <code>#PCDATA</code> content. As a result, <code>&lt;</code> and
  704. <code>&amp;</code> will be treated as the start of markup, and
  705. entities such as <code>&amp;lt;</code> and <code>&amp;amp;</code>
  706. will be recognized as entity references by the XML processor to
  707. <code>&lt;</code> and <code>&amp;</code> respectively. Wrapping
  708. the content of the script or style element within a <code>
  709. CDATA</code> marked section avoids the expansion of these
  710. entities.</p>
  711. <div class="good">
  712. <pre>
  713. &lt;script&gt;
  714. &lt;![CDATA[
  715. ... unescaped script content ...
  716. ]]&gt;
  717. &lt;/script&gt;
  718. </pre>
  719. </div>
  720. <p><code>CDATA</code> sections are recognized by the XML
  721. processor and appear as nodes in the Document Object Model, see
  722. <a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-E067D597">
  723. Section 1.3</a> of the DOM Level 1 Recommendation <a href="#ref-dom">[DOM]</a>.</p>
  724. <p>An alternative is to use external script and style
  725. documents.</p>
  726. <h2><a name="h-4.9" id="h-4.9">4.9 SGML exclusions</a></h2>
  727. <p>SGML gives the writer of a DTD the ability to exclude specific
  728. elements from being contained within an element. Such
  729. prohibitions (called "exclusions") are not possible in XML.</p>
  730. <p>For example, the HTML 4.0 Strict DTD forbids the nesting of an
  731. '<code>a</code>' element within another '<code>a</code>' element
  732. to any descendant depth. It is not possible to spell out such
  733. prohibitions in XML. Even though these prohibitions cannot be
  734. defined in the DTD, certain elements should not be nested. A
  735. summary of such elements and the elements that should not be
  736. nested in them is found in the normative <a href="#prohibitions">
  737. Appendix&#xA0;B</a>.</p>
  738. <h2><a name="h-4.10" id="h-4.10">4.10 The elements with 'id' and 'name'
  739. attributes</a></h2>
  740. <p>HTML 4.0 defined the <code>name</code> attribute for the elements
  741. <code>a</code>,
  742. <code>applet</code>, <code>frame</code>,
  743. <code>iframe</code>, <code>img</code>, and <code>map</code>.
  744. HTML 4.0 also introduced
  745. the <code>id</code> attribute. Both of these attributes are designed to be
  746. used as fragment identifiers.</p>
  747. <p>In XML, fragment identifiers are of type <code>ID</code>, and
  748. there can only be a single attribute of type <code>ID</code> per element.
  749. Therefore, in XHTML 1.0 the <code>id</code>
  750. attribute is defined to be of type <code>ID</code>. In order to
  751. ensure that XHTML 1.0 documents are well-structured XML documents, XHTML 1.0
  752. documents MUST use the <code>id</code> attribute when defining fragment
  753. identifiers, even on elements that historically have also had a
  754. <code>name</code> attribute.
  755. See the <a href="#guidelines">HTML Compatibility
  756. Guidelines</a> for information on ensuring such anchors are backwards
  757. compatible when serving XHTML documents as media type <code>text/html</code>.
  758. </p>
  759. <p>Note that in XHTML 1.0, the <code>name</code> attribute of these
  760. elements is formally deprecated, and will be removed in a
  761. subsequent version of XHTML.</p>
  762. <!--OddPage-->
  763. <h1><a name="issues" id="issues">5. Compatibility Issues</a></h1>
  764. <p>Although there is no requirement for XHTML 1.0 documents to be
  765. compatible with existing user agents, in practice this is easy to
  766. accomplish. Guidelines for creating compatible documents can be
  767. found in <a href="#guidelines">Appendix&#xA0;C</a>.</p>
  768. <h2><a name="media" id="media">5.1 Internet Media Type</a></h2>
  769. <p>As of the publication of this recommendation, the general
  770. recommended MIME labeling for XML-based applications
  771. has yet to be resolved.</p>
  772. <p>However, XHTML Documents which follow the guidelines set forth
  773. in <a href="#guidelines">Appendix C</a>, "HTML Compatibility Guidelines" may be
  774. labeled with the Internet Media Type "text/html", as they
  775. are compatible with most HTML browsers. This document
  776. makes no recommendation about MIME labeling of other
  777. XHTML documents.</p>
  778. <!--OddPage-->
  779. <h1><a name="future" id="future">6. Future Directions</a></h1>
  780. <p>XHTML 1.0 provides the basis for a family of document types
  781. that will extend and subset XHTML, in order to support a wide
  782. range of new devices and applications, by defining modules and
  783. specifying a mechanism for combining these modules. This
  784. mechanism will enable the extension and sub-setting of XHTML 1.0
  785. in a uniform way through the definition of new modules.</p>
  786. <h2><a name="mods" id="mods">6.1 Modularizing HTML</a></h2>
  787. <p>As the use of XHTML moves from the traditional desktop user
  788. agents to other platforms, it is clear that not all of the XHTML
  789. elements will be required on all platforms. For example a hand
  790. held device or a cell-phone may only support a subset of XHTML
  791. elements.</p>
  792. <p>The process of modularization breaks XHTML up into a series of
  793. smaller element sets. These elements can then be recombined to
  794. meet the needs of different communities.</p>
  795. <p>These modules will be defined in a later W3C document.</p>
  796. <h2><a name="extensions" id="extensions">6.2 Subsets and
  797. Extensibility</a></h2>
  798. <p>Modularization brings with it several advantages:</p>
  799. <ul>
  800. <li>
  801. <p>It provides a formal mechanism for sub-setting XHTML.</p>
  802. </li>
  803. <li>
  804. <p>It provides a formal mechanism for extending XHTML.</p>
  805. </li>
  806. <li>
  807. <p>It simplifies the transformation between document types.</p>
  808. </li>
  809. <li>
  810. <p>It promotes the reuse of modules in new document types.</p>
  811. </li>
  812. </ul>
  813. <h2><a name="profiles" id="profiles">6.3 Document
  814. Profiles</a></h2>
  815. <p>A document profile specifies the syntax and semantics of a set
  816. of documents. Conformance to a document profile provides a basis
  817. for interoperability guarantees. The document profile specifies
  818. the facilities required to process documents of that type, e.g.
  819. which image formats can be used, levels of scripting, style sheet
  820. support, and so on.</p>
  821. <p>For product designers this enables various groups to define
  822. their own standard profile.</p>
  823. <p>For authors this will obviate the need to write several
  824. different versions of documents for different clients.</p>
  825. <p>For special groups such as chemists, medical doctors, or
  826. mathematicians this allows a special profile to be built using
  827. standard HTML elements plus a group of elements geared to the
  828. specialist's needs.</p>
  829. <!--OddPage-->
  830. <h1><a name="appendices" id="appendices"></a>
  831. <a name="dtds" id="dtds">Appendix A. DTDs</a></h1>
  832. <p><b>This appendix is normative.</b></p>
  833. <p>These DTDs and entity sets form a normative part of this
  834. specification. The complete set of DTD files together with an XML
  835. declaration and SGML Open Catalog is included in the <a href="xhtml1.zip">zip file</a> for this specification.</p>
  836. <h2><a name="h-A1" id="h-A1">A.1 Document Type
  837. Definitions</a></h2>
  838. <p>These DTDs approximate the HTML 4.0 DTDs. It is likely that
  839. when the DTDs are modularized, a method of DTD construction will
  840. be employed that corresponds more closely to HTML 4.0.</p>
  841. <ul>
  842. <li>
  843. <p><a href="DTD/xhtml1-strict.dtd" type="text/plain">
  844. XHTML-1.0-Strict</a></p>
  845. </li>
  846. <li>
  847. <p><a href="DTD/xhtml1-transitional.dtd" type="text/plain">
  848. XHTML-1.0-Transitional</a></p>
  849. </li>
  850. <li>
  851. <p><a href="DTD/xhtml1-frameset.dtd" type="text/plain">
  852. XHTML-1.0-Frameset</a></p>
  853. </li>
  854. </ul>
  855. <h2><a name="h-A2" id="h-A2">A.2 Entity Sets</a></h2>
  856. <p>The XHTML entity sets are the same as for HTML 4.0, but have
  857. been modified to be valid XML 1.0 entity declarations. Note the
  858. entity for the Euro currency sign (<code>&amp;euro;</code> or
  859. <code>&amp;#8364;</code> or <code>&amp;#x20AC;</code>) is defined
  860. as part of the special characters.</p>
  861. <ul>
  862. <li>
  863. <p><a href="DTD/xhtml-lat1.ent">Latin-1 characters</a></p>
  864. </li>
  865. <li>
  866. <p><a href="DTD/xhtml-special.ent">Special characters</a></p>
  867. </li>
  868. <li>
  869. <p><a href="DTD/xhtml-symbol.ent">Symbols</a></p>
  870. </li>
  871. </ul>
  872. <!--OddPage-->
  873. <h1><a name="prohibitions" id="prohibitions">Appendix B. Element
  874. Prohibitions</a></h1>
  875. <p><b>This appendix is normative.</b></p>
  876. <p>The following elements have prohibitions on which elements
  877. they can contain (see <a href="#h-4.9">Section 4.9</a>). This
  878. prohibition applies to all depths of nesting, i.e. it contains
  879. all the descendant elements.</p>
  880. <dl><dt><code class="tag">a</code></dt>
  881. <dd>
  882. cannot contain other <code>a</code> elements.</dd>
  883. <dt><code class="tag">pre</code></dt>
  884. <dd>cannot contain the <code>img</code>, <code>object</code>,
  885. <code>big</code>, <code>small</code>, <code>sub</code>, or <code>
  886. sup</code> elements.</dd>
  887. <dt><code class="tag">button</code></dt>
  888. <dd>cannot contain the <code>input</code>, <code>select</code>,
  889. <code>textarea</code>, <code>label</code>, <code>button</code>,
  890. <code>form</code>, <code>fieldset</code>, <code>iframe</code> or
  891. <code>isindex</code> elements.</dd>
  892. <dt><code class="tag">label</code></dt>
  893. <dd>cannot contain other <code class="tag">label</code> elements.</dd>
  894. <dt><code class="tag">form</code></dt>
  895. <dd>cannot contain other <code>form</code> elements.</dd>
  896. </dl>
  897. <!--OddPage-->
  898. <h1><a name="guidelines" id="guidelines">Appendix C.
  899. HTML Compatibility Guidelines</a></h1>
  900. <p><b>This appendix is informative.</b></p>
  901. <p>This appendix summarizes design guidelines for authors who
  902. wish their XHTML documents to render on existing HTML user
  903. agents.</p>
  904. <h2>C.1 Processing Instructions</h2>
  905. <p>Be aware that processing instructions are rendered on some
  906. user agents. However, also note that when the XML declaration is not included
  907. in a document, the document can only use the default character encodings UTF-8
  908. or UTF-16.</p>
  909. <h2>C.2 Empty Elements</h2>
  910. <p>Include a space before the trailing <code>/</code> and <code>
  911. &gt;</code> of empty elements, e.g. <code class="greenmono">
  912. &lt;br&#xA0;/&gt;</code>, <code class="greenmono">
  913. &lt;hr&#xA0;/&gt;</code> and <code class="greenmono">&lt;img
  914. src="karen.jpg" alt="Karen"&#xA0;/&gt;</code>. Also, use the
  915. minimized tag syntax for empty elements, e.g. <code class="greenmono">&lt;br /&gt;</code>, as the alternative syntax <code class="greenmono">&lt;br&gt;&lt;/br&gt;</code> allowed by XML
  916. gives uncertain results in many existing user agents.</p>
  917. <h2>C.3 Element Minimization and Empty Element Content</h2>
  918. <p>Given an empty instance of an element whose content model is
  919. not <code>EMPTY</code> (for example, an empty title or paragraph)
  920. do not use the minimized form (e.g. use <code class="greenmono">
  921. &lt;p&gt; &lt;/p&gt;</code> and not <code class="greenmono">
  922. &lt;p&#xA0;/&gt;</code>).</p>
  923. <h2>C.4 Embedded Style Sheets and Scripts</h2>
  924. <p>Use external style sheets if your style sheet uses <code>
  925. &lt;</code> or <code>&amp;</code> or <code>]]&gt;</code> or <code>--</code>. Use
  926. external scripts if your script uses <code>&lt;</code> or <code>
  927. &amp;</code> or <code>]]&gt;</code> or <code>--</code>. Note that XML parsers
  928. are permitted to silently remove the contents of comments. Therefore, the historical
  929. practice of "hiding" scripts and style sheets within comments to make the
  930. documents backward compatible is likely to not work as expected in XML-based
  931. implementations.</p>
  932. <h2>C.5 Line Breaks within Attribute Values</h2>
  933. <p>Avoid line breaks and multiple whitespace characters within
  934. attribute values. These are handled inconsistently by user
  935. agents.</p>
  936. <h2>C.6 Isindex</h2>
  937. <p>Don't include more than one <code>isindex</code> element in
  938. the document <code>head</code>. The <code>isindex</code> element
  939. is deprecated in favor of the <code>input</code> element.</p>
  940. <h2>C.7 The <code>lang</code> and <code>xml:lang</code> Attributes</h2>
  941. <p>Use both the <code>lang</code> and <code>xml:lang</code>
  942. attributes when specifying the language of an element. The value
  943. of the <code>xml:lang</code> attribute takes precedence.</p>
  944. <h2>C.8 Fragment Identifiers</h2>
  945. <p>In XML, <abbr title="Uniform Resource Identifiers">URIs</abbr> [<a href="#ref-rfc2396">RFC2396</a>] that end with fragment identifiers of the form
  946. <code>"#foo"</code> do not refer to elements with an attribute
  947. <code>name="foo"</code>; rather, they refer to elements with an
  948. attribute defined to be of type <code>ID</code>, e.g., the <code>
  949. id</code> attribute in HTML 4.0. Many existing HTML clients don't
  950. support the use of <code>ID</code>-type attributes in this way,
  951. so identical values may be supplied for both of these attributes to ensure
  952. maximum forward and backward compatibility (e.g., <code class="greenmono">&lt;a id="foo" name="foo"&gt;...&lt;/a&gt;</code>).</p>
  953. <p>Further, since the set of
  954. legal values for attributes of type <code>ID</code> is much smaller than
  955. for those of type <code>CDATA</code>, the type of the <code>name</code>
  956. attribute has been changed to <code>NMTOKEN</code>. This attribute is
  957. constrained such that it can only have the same values as type
  958. <code>ID</code>, or as the <code>Name</code> production in XML 1.0 Section
  959. 2.5, production 5. Unfortunately, this constraint cannot be expressed in the
  960. XHTML 1.0 DTDs. Because of this change, care must be taken when
  961. converting existing HTML documents. The values of these attributes
  962. must be unique within the document, valid, and any references to these
  963. fragment identifiers (both
  964. internal and external) must be updated should the values be changed during
  965. conversion.</p>
  966. <p>Finally, note that XHTML 1.0 has deprecated the
  967. <code>name</code> attribute of the <code>a</code>, <code>applet</code>, <code>frame</code>, <code>iframe</code>, <code>img</code>, and <code>map</code>
  968. elements, and it will be
  969. removed from XHTML in subsequent versions.</p>
  970. <h2>C.9 Character Encoding</h2>
  971. <p>To specify a character encoding in the document, use both the
  972. encoding attribute specification on the xml declaration (e.g.
  973. <code class="greenmono">&lt;?xml version="1.0"
  974. encoding="EUC-JP"?&gt;</code>) and a meta http-equiv statement
  975. (e.g. <code class="greenmono">&lt;meta http-equiv="Content-type"
  976. content='text/html; charset="EUC-JP"'&#xA0;/&gt;</code>). The
  977. value of the encoding attribute of the xml processing instruction
  978. takes precedence.</p>
  979. <h2>C.10 Boolean Attributes</h2>
  980. <p>Some HTML user agents are unable to interpret boolean
  981. attributes when these appear in their full (non-minimized) form,
  982. as required by XML 1.0. Note this problem doesn't effect user
  983. agents compliant with HTML 4.0. The following attributes are
  984. involved: <code>compact</code>, <code>nowrap</code>, <code>
  985. ismap</code>, <code>declare</code>, <code>noshade</code>, <code>
  986. checked</code>, <code>disabled</code>, <code>readonly</code>,
  987. <code>multiple</code>, <code>selected</code>, <code>
  988. noresize</code>, <code>defer</code>.</p>
  989. <h2>C.11 Document Object Model and XHTML</h2>
  990. <p>
  991. The Document Object Model level 1 Recommendation [<a href="#ref-dom">DOM</a>]
  992. defines document object model interfaces for XML and HTML 4.0. The HTML 4.0
  993. document object model specifies that HTML element and attribute names are
  994. returned in upper-case. The XML document object model specifies that
  995. element and attribute names are returned in the case they are specified. In
  996. XHTML 1.0, elements and attributes are specified in lower-case. This apparent difference can be
  997. addressed in two ways:
  998. </p>
  999. <ol>
  1000. <li>Applications that access XHTML documents served as Internet media type
  1001. <code>text/html</code>
  1002. via the <abbr title="Document Object Model">DOM</abbr> can use the HTML DOM,
  1003. and can rely upon element and attribute names being returned in
  1004. upper-case from those interfaces.</li>
  1005. <li>Applications that access XHTML documents served as Internet media types
  1006. <code>text/xml</code> or <code>application/xml</code>
  1007. can also use the XML DOM. Elements and attributes will be returned in lower-case.
  1008. Also, some XHTML elements may or may
  1009. not appear
  1010. in the object tree because they are optional in the content model
  1011. (e.g. the <code>tbody</code> element within
  1012. <code>table</code>). This occurs because in HTML 4.0 some elements were
  1013. permitted to be minimized such that their start and end tags are both omitted
  1014. (an SGML feature).
  1015. This is not possible in XML. Rather than require document authors to insert
  1016. extraneous elements, XHTML has made the elements optional.
  1017. Applications need to adapt to this
  1018. accordingly.</li>
  1019. </ol>
  1020. <h2>C.12 Using Ampersands in Attribute Values</h2>
  1021. <p>
  1022. When an attribute value contains an ampersand, it must be expressed as a character
  1023. entity reference
  1024. (e.g. "<code>&amp;amp;</code>"). For example, when the
  1025. <code>href</code> attribute
  1026. of the <code>a</code> element refers to a
  1027. CGI script that takes parameters, it must be expressed as
  1028. <code>http://my.site.dom/cgi-bin/myscript.pl?class=guest&amp;amp;name=user</code>
  1029. rather than as
  1030. <code>http://my.site.dom/cgi-bin/myscript.pl?class=guest&amp;name=user</code>.
  1031. </p>
  1032. <h2>C.13 Cascading Style Sheets (CSS) and XHTML</h2>
  1033. <p>The Cascading Style Sheets level 2 Recommendation [<a href="#ref-css2">CSS2</a>] defines style
  1034. properties which are applied to the parse tree of the HTML or XML
  1035. document. Differences in parsing will produce different visual or
  1036. aural results, depending on the selectors used. The following hints
  1037. will reduce this effect for documents which are served without
  1038. modification as both media types:</p>
  1039. <ol>
  1040. <li>
  1041. CSS style sheets for XHTML should use lower case element and
  1042. attribute names.</li>
  1043. <li>In tables, the tbody element will be inferred by the parser of an
  1044. HTML user agent, but not by the parser of an XML user agent. Therefore
  1045. you should always explicitely add a tbody element if it is referred to
  1046. in a CSS selector.</li>
  1047. <li>Within the XHTML name space, user agents are expected to
  1048. recognize the "id" attribute as an attribute of type ID.
  1049. Therefore, style sheets should be able to continue using the
  1050. shorthand "#" selector syntax even if the user agent does not read
  1051. the DTD.</li>
  1052. <li>Within the XHTML name space, user agents are expected to
  1053. recognize the "class" attribute. Therefore, style sheets should be
  1054. able to continue using the shorthand "." selector syntax.</li>
  1055. <li>
  1056. CSS defines different conformance rules for HTML and XML documents;
  1057. be aware that the HTML rules apply to XHTML documents delivered as
  1058. HTML and the XML rules apply to XHTML documents delivered as XML.</li>
  1059. </ol>
  1060. <!--OddPage-->
  1061. <h1><a name="acks" id="acks">Appendix D.
  1062. Acknowledgements</a></h1>
  1063. <p><b>This appendix is informative.</b></p>
  1064. <p>This specification was written with the participation of the
  1065. members of the W3C HTML working group:</p>
  1066. <dl>
  1067. <dd>Steven Pemberton, CWI (HTML Working Group Chair)<br />
  1068. Murray Altheim, Sun Microsystems<br />
  1069. Daniel Austin, CNET: The Computer Network<br />
  1070. Frank Boumphrey, HTML Writers Guild<br />
  1071. John Burger, Mitre<br />
  1072. Andrew W. Donoho, IBM<br />
  1073. Sam Dooley, IBM<br />
  1074. Klaus Hofrichter, GMD<br />
  1075. Philipp Hoschka, W3C<br />
  1076. Masayasu Ishikawa, W3C<br />
  1077. Warner ten Kate, Philips Electronics<br />
  1078. Peter King, Phone.com<br />
  1079. Paula Klante, JetForm<br />
  1080. Shin'ichi Matsui, W3C/Panasonic<br />
  1081. Shane McCarron, Applied Testing and Technology (The Open Group through August
  1082. 1999)<br />
  1083. Ann Navarro, HTML Writers Guild<br />
  1084. Zach Nies, Quark<br />
  1085. Dave Raggett, W3C/HP (W3C lead for HTML)<br />
  1086. Patrick Schmitz, Microsoft<br />
  1087. Sebastian Schnitzenbaumer, Stack Overflow<br />
  1088. Chris Wilson, Microsoft<br />
  1089. Ted Wugofski, Gateway 2000<br />
  1090. Dan Zigmond, WebTV Networks</dd>
  1091. </dl>
  1092. <!--OddPage-->
  1093. <h1><a name="refs" id="refs">Appendix E. References</a></h1>
  1094. <p><b>This appendix is informative.</b></p>
  1095. <dl>
  1096. <dt><a name="ref-css2" id="ref-css2"><b>[CSS2]</b></a></dt>
  1097. <dd><a href="http://www.w3.org/TR/REC-CSS2">"Cascading Style Sheets, level 2 (CSS2) Specification"</a>, B.
  1098. Bos, H. W. Lie, C. Lilley, I. Jacobs, 12 May 1998.<br />
  1099. Available at: <a href="http://www.w3.org/TR/REC-CSS2">
  1100. http://www.w3.org/TR/REC-CSS2</a></dd>
  1101. <dt><a name="ref-dom" id="ref-dom"><b>[DOM]</b></a></dt>
  1102. <dd><a href="http://www.w3.org/TR/REC-DOM-Level-1">"Document Object Model (DOM) Level 1 Specification"</a>, Lauren
  1103. Wood <i>et al.</i>, 1 October 1998.<br />
  1104. Available at: <a href="http://www.w3.org/TR/REC-DOM-Level-1">
  1105. http://www.w3.org/TR/REC-DOM-Level-1</a></dd>
  1106. <dt><a name="ref-html4" id="ref-html4"><b>[HTML]</b></a></dt>
  1107. <dd><a href="http://www.w3.org/TR/1999/PR-html40-19990824">"HTML 4.01 Specification"</a>, D. Raggett, A. Le&#xA0;Hors, I.
  1108. Jacobs, 24 August 1999.<br />
  1109. Available at: <a href="http://www.w3.org/TR/1999/PR-html40-19990824">
  1110. http://www.w3.org/TR/1999/PR-html40-19990824</a></dd>
  1111. <dt><a name="ref-posix" id="ref-posix"><b>[POSIX.1]</b></a></dt>
  1112. <dd>"ISO/IEC 9945-1:1990 Information Technology - Portable
  1113. Operating System Interface (POSIX) - Part 1: System Application
  1114. Program Interface (API) [C Language]", Institute of Electrical
  1115. and Electronics Engineers, Inc, 1990.</dd>
  1116. <dt><a name="ref-rfc2046" id="ref-rfc2046"><b>
  1117. [RFC2046]</b></a></dt>
  1118. <dd><a href="http://www.ietf.org/rfc/rfc2046.txt">"RFC2046: Multipurpose Internet Mail Extensions (MIME) Part
  1119. Two: Media Types"</a>, N. Freed and N. Borenstein, November
  1120. 1996.<br />
  1121. Available at <a href="http://www.ietf.org/rfc/rfc2046.txt">
  1122. http://www.ietf.org/rfc/rfc2046.txt</a>. Note that this RFC
  1123. obsoletes RFC1521, RFC1522, and RFC1590.</dd>
  1124. <dt><a name="ref-rfc2119" id="ref-rfc2119"><b>
  1125. [RFC2119]</b></a></dt>
  1126. <dd><a href="http://www.ietf.org/rfc/rfc2119.txt">"RFC2119: Key words for use in RFCs to Indicate Requirement
  1127. Levels"</a>, S. Bradner, March 1997.<br />
  1128. Available at: <a href="http://www.ietf.org/rfc/rfc2119.txt">
  1129. http://www.ietf.org/rfc/rfc2119.txt</a></dd>
  1130. <dt><a name="ref-rfc2376" id="ref-rfc2376"><b>
  1131. [RFC2376]</b></a></dt>
  1132. <dd><a href="http://www.ietf.org/rfc/rfc2376.txt">"RFC2376: XML Media Types"</a>, E. Whitehead, M. Murata, July
  1133. 1998.<br />
  1134. Available at: <a href="http://www.ietf.org/rfc/rfc2376.txt">
  1135. http://www.ietf.org/rfc/rfc2376.txt</a></dd>
  1136. <dt><a name="ref-rfc2396" id="ref-rfc2396"><b>
  1137. [RFC2396]</b></a></dt>
  1138. <dd><a href="http://www.ietf.org/rfc/rfc2396.txt">"RFC2396: Uniform Resource Identifiers (URI): Generic
  1139. Syntax"</a>, T. Berners-Lee, R. Fielding, L. Masinter, August
  1140. 1998.<br />
  1141. This document updates RFC1738 and RFC1808.<br />
  1142. Available at: <a href="http://www.ietf.org/rfc/rfc2396.txt">
  1143. http://www.ietf.org/rfc/rfc2396.txt</a></dd>
  1144. <dt><a name="ref-xml" id="ref-xml"><b>[XML]</b></a></dt>
  1145. <dd><a href="http://www.w3.org/TR/REC-xml">"Extensible Markup Language (XML) 1.0 Specification"</a>, T.
  1146. Bray, J. Paoli, C. M. Sperberg-McQueen, 10 February 1998.<br />
  1147. Available at: <a href="http://www.w3.org/TR/REC-xml">
  1148. http://www.w3.org/TR/REC-xml</a></dd>
  1149. <dt><a name="ref-xmlns" id="ref-xmlns"><b>[XMLNAMES]</b></a></dt>
  1150. <dd><a href="http://www.w3.org/TR/REC-xml-names">"Namespaces in XML"</a>, T. Bray, D. Hollander, A. Layman, 14
  1151. January 1999.<br />
  1152. XML namespaces provide a simple method for qualifying names used
  1153. in XML documents by associating them with namespaces identified
  1154. by URI.<br />
  1155. Available at: <a href="http://www.w3.org/TR/REC-xml-names">
  1156. http://www.w3.org/TR/REC-xml-names</a></dd>
  1157. </dl>
  1158. <p><a href="http://www.w3.org/WAI/WCAG1AAA-Conformance" title="Explanation of Level Triple-A Conformance">
  1159. <img height="32" width="88" src="wcag1AAA.gif" alt="Level Triple-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0" /></a></p>
  1160. <div class="navbar">
  1161. <hr />
  1162. <a href="#toc">table of contents</a>
  1163. </div>
  1164. </body>
  1165. </html>