This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 740 - Doctype rewrite vs. XmlDecl and Source Listing
Summary: Doctype rewrite vs. XmlDecl and Source Listing
Status: RESOLVED FIXED
Alias: None
Product: Validator
Classification: Unclassified
Component: check (show other bugs)
Version: 0.6.7
Hardware: Other other
: P2 enhancement
Target Milestone: ---
Assignee: Terje Bless
QA Contact: qa-dev tracking
URL: http://validator.w3.org/check?uri=htt...
Whiteboard:
Keywords:
Depends on: 858 857
Blocks:
  Show dependency treegraph
 
Reported: 2004-05-23 17:43 UTC by Bj
Modified: 2009-02-02 21:32 UTC (History)
1 user (show)

See Also:


Attachments

Description Bj 2004-05-23 17:43:19 UTC
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.
Comment 1 Terje Bless 2004-09-01 11:16:52 UTC
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.

Comment 2 Olivier Thereaux 2009-02-02 21:32:00 UTC
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.