Re: Whats wrong with W3C Validator?

Otto,

The doctype declaration must be at the top of the document, and can  
only be preceded by whitespace to be valid.

Blocks of PHP code should cause the validator to fail, not only  
because the PHP open and close tags are not valid HTML, but also  
because the PHP block may contain characters that are not valid in HTML.

In addition, the contents of your document may be very different once  
PHP has processed it.  So validating the document in its raw form is  
not a real test of its validity.

Robin Daugherty
robin@robindaugherty.net
1-513-252-2426

http://robindaugherty.net

On Mar 19, 2008, at 4:19 PM, Otto wrote:

>
> Good evening,
>
> I got the same error message like described in the mail of Jozef
> Rusn?<jozef@boberdoo.com>  from Date: Tue, 18 Mar 2008 10:14:24 +0100
>
> The reason for this is obviously a change in W3C Validator about PHP
> in XHTML.
>
> I checked usually my files via file-upload, so the php-code is still
> in the file.
>
> The first lines of all my XHTML-files are:
>
> <?php
> include (//XXXXXXXXX);
> ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd 
> ">
>
> In the past W3C-Validator ignored the <?php ... ?> and checked only  
> the rest. From Today all my files are marked in error with the same  
> error message:
>
> ,----- [  ]
> |     This page is *not* Valid (no Doctype found)!
> |
> | Validation Output: 1 Error Error /Line 1, Column 0/: end of  
> document in
> | prolog.
> `-----
>
> If the files are checked via an URI, all is fine!
>
>
> Regards
>
> Otto
>
>
>
>

Received on Thursday, 20 March 2008 08:42:36 UTC