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

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 UTC