I was going through corrections to get my pages to validate. I got it down to one error left on the page. After correcting that error, the next run of the validator gave 29 errors, one for each entity on the page. For example was now considered invalid. Here is one of the error messages:
Line 67, column 12: Entity ‘nbsp’ not defined.
<h1> <a href="search-by-keyword.php?usertype=pri">M ...
In addition one other error was the following:
Line 1, column 6: XML declaration allowed only at the start of the document
<?xml version="1.0" encoding="UTF-8"?>
But this is the only declaration.
So as a test, I reverted the final error correction. After doing that, the validator once again says that there is only one validation error in the file.
As a side note, I did find an posting on the web from 2007 seeming to report the same situation. See http://lists.w3.org/Archives/Public/www-validator/2007Jul/0140.html
What’s going on?
The solution to this issue was to remove a leading space that got in from of the tag, which is not allowed per the specification. In particular, the error message was exactly correct:
By “start of the document” is meant “1st character of the document”, and no leading white-space is allowed.
This removed the above error as well as the 28 other errors.