W3C home > Mailing lists > Public > www-html@w3.org > March 2001

XML declaration in XHTML causes problems

From: Peter Foti (PeterF) <PeterF@SystolicNetworks.com>
Date: Wed, 28 Mar 2001 15:09:07 -0500
Message-ID: <A10A983C9DFBD4119F0300104B2EA6B7028D04@ZIPPY>
To: "'www-html@w3.org'" <www-html@w3.org>
The XHTML 1.0 Recommendation (http://www.w3.org/TR/xhtml1/#docconf)
states:
<quote>
Here is an example of a minimal XHTML document.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Virtual Library</title>
  </head>
  <body>
    <p>Moved to <a href="http://vlib.org/">vlib.org</a>.</p>
  </body>
</html>
Note that in this example, the XML declaration is included. An XML
declaration like the one above is 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 when the
character encoding of the document is other than the default UTF-8 or
UTF-16.

</quote>

I have 2 comments.
1.  This says it's an example of a "minimal XHTML document".  That is
not true, because a "minimal" XHTML document does not require the XML
declaration.  Nor does it require a <p> or <a> tag.  I think the work
"minimal" should be removed from this statement.
2.  I have found that including the XML declaration on the first line
causes pages to not be rendered as HTML in some browsers, including (but
not limited to) IE 5.5 for Mac.  Would you call this "breaking backwards
compatability"?


Peter Foti
Systolic Networks
Phone: (603) 870-8170
Fax: (603) 870-8170
Received on Wednesday, 28 March 2001 15:06:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:45 GMT