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