xhtml1.xhtml 55 KB

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