W3C home > Mailing lists > Public > www-validator@w3.org > November 2003

Re: First two bytes of a file

From: Nick Kew <nick@webthing.com>
Date: Sun, 23 Nov 2003 13:04:04 +0000 (GMT)
To: David Edwards <dave@revlob.com>
Cc: www-validator@w3.org
Message-ID: <Pine.LNX.4.53.0311231249440.1771@hugin.webthing.com>

On Fri, 21 Nov 2003, David Edwards wrote:

> #!/usr/bin/perl -w
> #please note that the total number of newlines in the following first two lines is three
> print qq|Content-type: text/html\n\n

You've declared text/html, so we need to apply HTML rules.  So there's no
problem with leading whitespace in your document.

> <?xml version="1.0"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

That's XHTML 1.1, which is not a valid HTML doctype.  The validator should

> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
> <head>
> 	<title>No CSS Validation</title>
> 	<link rel="StyleSheet" href="default.css" type="text/css"
> 		title=default media="screen" />
> </head>
> <body><p>The Jigsaw CSS validator will refuse to validate the generated
> XHTML, due to "bad" XHTML, even though the XHTML validator reports conformance.</p></body>
> </html>|;

That is, typos aside, valid XML and XHTML.  If you send it with an XML or
XHTML Content-Type, you get the behaviour you expected (or report a bug).

Nick Kew
Received on Sunday, 23 November 2003 17:12:57 UTC

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