W3C home > Mailing lists > Public > www-validator@w3.org > September 2001

Validator says non-well-formed document is well-formed

From: Karl Ove Hufthammer <huftis@bigfoot.com>
Date: Wed, 5 Sep 2001 20:40:06 +0200
Message-ID: <000d01c1363a$2efcb140$a2448ed5@huftis>
To: <www-validator@w3.org>
According to the W3C Validator, the following piece of XHTML is well-formed
(and valid):

<?xml version="1.0" charset="iso-8859-1"?>

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

<html xml:lang="en">

<head><title/></head>

<body><p/></body>

</html>

But the XML declaration can only be written:

'<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'

(I.e., there is no 'charset' pseudo-attribute.)

(Both the MSXML 4 parser and Ælfred (another XML parser) chokes on the
document above, but if I change 'charset' to 'encoding', it works fine.)

-- 
Karl Ove Hufthammer
Received on Wednesday, 5 September 2001 14:40:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:13:59 GMT