From: Tantek Çelik Date: Sun Feb 23, 2003 11:08:34 AM America/Denver To: Mac Internet Explorer Talk Subject: Re: CSS and Standards-Compliance mode in IE6 Reply-To: "Mac Internet Explorer Talk" On 2/23/03 8:07 AM, "jsiburt@mac.com" wrote: --> Tantek: --> I am assuming you would be the best person to answer this question, yet --> I am posing it to all. Is this statement from a SitePoint article --> accurate. If so should all of the sites I am developing and have --> developed with XHTML have the XMl declaration removed? In short: If you are trying to build _XHTML_ that is backwards compatible with today's _HTML_ user agents, then yes, you should remove the XML declaration. Longer: IE5/Mac and IE6/Windows are _HTML_ user agents. They DO NOT have support for XHTML. However, by following the suggestions in Appendix C of XHTML 1.0, it is possible to write valid XHTML which can be sent as text/html, which IE (all platforms) will treat as HTML and will "work" as expected. http://www.w3.org/TR/xhtml1/Overview.html#guidelines --> What are the ramifications of removing the declaration pending the --> possible use of a future XML workflow? I am not that familiar with XML workflow so I don't know how to answer your question. I do know that the previous question gave the example of the xml declaration: is completely useless, because it gives you no information. It does not set the character encoding, and until there is a future version of XML, all XML documents can be assumed to be version 1.0 anyway. Thus I see *no* harm in removing this particular xml declaration in *all* cases, as conformant XML UAs MUST treat documents with or without it the same way per XML 1.0 which states that the declaration is optional. --> IE6 decides whether to use Standards-Compliant mode based on the DOCTYPE --> of the page. Yes, both IE5/Mac and IE6/Windows use the DOCTYPE as a hint as to whether to render the page strictly to the CSS standards or in a backwards compatible quirks mode. http://msdn.microsoft.com/library/en-us/dnie60/html/cssenhancements.asp --> Unfortunately, this detection mechanism runs into problems --> with XHTML documents. XHTML documents are not supported by IE. You can fool IE into thinking they are HTML documents and processing them as such by following the abovementioned guidelines in Appendix C. --> The standards (not to mention the default templates in programs like --> Dreamweaver MX) tell us that a typical XHTML document should look like --> this: --> --> --> "-//W3C//DTD XHTML 1.0 Transitional//EN" --> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> --> --> --> Document Title --> content="text/html; charset=iso-8859-1" /> --> --> --> --> Actually, in that case as well, since you are using a META tag to declare the charset, again, the xml declaration is completely useless and unnecessary. --> Unfortunately, the declaration at the top of the page --> prevents IE6 from seeing the !DOCTYPE Apparently. and that browser will disable Standards-Compliant mode on pages that were obviously written with Web standards very much in mind. That page without the xml declaration is just as "web standards compliant" as with it. In both examples you have provided so far, the xml declaration is simply a waste of space in the document. --> Fortunately, the XML standards allow for the declaration to --> be left out if you're happy with the default values. Leaving it out lets --> IE6 find the !DOCTYPE and run in Standards-Compliant mode. Yes. Best to leave out the XML declaration if you're sending XHTML which you want interpreted as HTML by HTML user agents. Hope that helps, Tantek