This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
http://validator.w3.org/check?uri=http://www.bjoernsworld.de/temp/xmldecl- following-doctype.html;doctype=XHTML+1.0+Strict;ss gives 1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2: <?xml version='1.0'?> 3: <html xmlns="http://www.w3.org/1999/xhtml"> 4: <head> 5: <title></title> 6: </head> 7: 8: <body> 9: <p>...</p> 10: </body> 11: </html> which is bad as the XML Declaration must appear prior to any markup. It is also bad as that is not the actual source code which one would expect to see here.
Hmmm. I think perhaps this is more a case for managing expectations. The DOCTYPE Override specifically works only to replace an existing DOCTYPE delcaration with a new one, or, if one is not present, to insert one at the beginning of the document. We might be able to take the XML Declaration into account, but there is no way this feature can DWIM in every conceivable situation. Distinguishing the inserted DOCTYPE from the original source text would be a good enhancement to add, but I'm reluctant to accept it as a "bug" as the source listing is there to show you what data the Markup Validator has processed;the original source is readily available to you in your browser's "View Source" function or in the original file on disk. I'm opening two new Enhancement bugs for this -- Bug #857 and Bug #858 -- as they're quite different in terms of implementation.
I believe this has been fixed recently while rewriting the override code. The test case document, at least, now passes with doctype override done after the xmldect.