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 30177 - Unexpected DOCTYPE declaration error
Summary: Unexpected DOCTYPE declaration error
Status: NEW
Alias: None
Product: Validator
Classification: Unclassified
Component: check (show other bugs)
Version: 1.1
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-04 19:06 UTC by Nick St. Cavish
Modified: 2017-09-11 18:15 UTC (History)
1 user (show)

See Also:


Attachments

Description Nick St. Cavish 2017-09-04 19:06:08 UTC
I am getting the following w3c error when checking my html document:
   Error Line 1, Column 1: end of document in prolog
<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML …
✉
This error may appear when the validator receives an empty document. Please make sure that the document you are uploading is not empty, and report any discrepancy.

The xml instructions comes from an include (inc) file:

   <?php echo "<?xml version='1.0' encoding='UTF-8'?>"; ?>
   
as do the doctype declaration specifications:

   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

The beginning of the html documents contains the following text:

   <?php error_reporting(E_ALL); ?>
   <?php include("includes/xml_instr.inc"); ?>
   <?php include("includes/map_doc_type.inc"); ?>

I have not changed the two include files for years, and have never seen this w3c error message. In fact, the same error is encountered now on html web pages generated several years ago, which never had the error.

Has something changed recently in the w3c validator to cause this error? If not, what am I doing wrong?
Comment 1 Rich Pasco 2017-09-05 05:25:10 UTC
I have had the same experience.  Starting today, all my pages which used to validate correctly are now giving this error message:

Error Line 1, Column 1: end of document in prolog
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
This error may appear when the validator receives an empty document.
Please make sure that the document you are uploading is not empty, and
report any discrepancy.

The pages haven't changed, so the validator must have.

A browser still displays the pages correctly, so I am certain they are not empty.

     - Rich
Comment 2 Nick St. Cavish 2017-09-05 21:18:02 UTC
Problem is now fixed. Same html files that generated the error yesterday no longer do so. 

Thanks to whoever for the quick response.
Comment 3 Rich Pasco 2017-09-07 15:35:04 UTC
I agree that it has been fixed.  My same pages that gave this error now validate correctly.
Comment 4 Rich Pasco 2017-09-11 18:15:58 UTC
It's BACK again.  As of 2017-09-11 18:13 UTC, attempting to validate my page
http://www.richpasco.org/
gives:

Validation Output: 1 Error
    Error Line 1, Column 1: end of document in prolog
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    This error may appear when the validator receives an empty document. Please make sure that the document you are uploading is not empty, and report any discrepancy.