W3C home > Mailing lists > Public > www-validator@w3.org > April 2006

Re: XML or SGML?

From: David Dorward <david@dorward.me.uk>
Date: Wed, 19 Apr 2006 07:47:04 +0100
To: "Grant, Melinda" <melinda.grant@hp.com>
Cc: www-validator@w3.org
Message-Id: <1145429226.7874.5.camel@cyberman.dorward.me.uk>

On Tue, 2006-04-18 at 16:13 -0700, Grant, Melinda wrote:
> The file at http://www.savagecreek.net/CSS/002.htm fails validation
> with 0 errors.
> The following warning is provided:
>  The MIME Media Type (text/html) for this document is used to serve
> both SGML and XML based documents, and it is not possible to
> disambiguate it based on the DOCTYPE Declaration in your document.
> Parsing will continue in SGML mode.
> followed by:
>  Namespace "" found, but document type is not XML!

The validator is parsing the document as text/html and thus using SGML
rules. It will check for certain XHTML Doctypes and switch to XML mode
for those, but for the reasons I explain below, XHTML Print 1.0 isn't
among them. 
> However, the document preface includes:
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML-Print 1.0//EN"
>       "http://www.w3.org/MarkUp/DTD/xhtml-print10.dtd">

The text/html content type (which your webserver sends, as part of the
HTTP headers, before sending the document) is for HTML documents. XHTML
1.0 documents that follow the guidelines set down in Appendix C of the
XHTML 1.0 specification are allowed to be served as text/html (although
its a silly idea).

XHTML Print 1.0 (based on XHTML Basic) is not XHTML 1.0. Appendix C does
not apply. XHTML Print 1.0 documents "SHOULD NOT" be served as
text/html. You should reconfigure your server to send a more appropriate
content-type (this might be just a matter of renaming the file).


(I read the mailing list. Please direct responses there and do not CC

David Dorward                           <http://dorward.me.uk/>
"Anybody remotely interesting is mad, in some way or another."
                             -- The Greatest Show in the Galaxy
Received on Wednesday, 19 April 2006 06:49:15 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:17:48 UTC