MyBB Community Forums

Full Version: [F] XHTML Validation fails
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
As of the Validome validation result there are 2 things missing in the XHTML header:
  • An 'xmlns' attribute in the <html> tag
  • A meta tag specifying the scripting language:
    <meta http-equiv="Content-Script-Type" content="text/javascript" />

I fixed this for me by inserting the following line on line 222 in inc/functions.php
$contents = str_replace("<html", "<html xmlns=\"http://www.w3.org/1999/xhtml\"", $contents);

as well as adding the meta tag to the headerinclude template.
And according to W3.org it is VALID

VALIDATE
zaher1988 Wrote:And according to W3.org it is VALID
Please take a look at the appropriate DTD.

According to:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd (line 277)
<!ATTLIST html
  %i18n;
  id          ID             #IMPLIED
  xmlns       %URI;          #FIXED 'http://www.w3.org/1999/xhtml'
  >

And according to (though HTML) http://www.w3.org/TR/html4/interact/scri...h-18.2.2.1:
Quote:Authors should specify the default scripting language for all scripts in a document by including the following META declaration in the HEAD:

<META http-equiv="Content-Script-Type" content="type">
...
Documents that do not specify default scripting language information and that contain elements that specify an intrinsic event script are incorrect. User agents may still attempt to interpret incorrectly specified scripts but are not required to.

Btw: Why W3C Validator did not found these "bugs".
Quote:The W3C validator is a strict SGML validator, and therefore cannot be expected to cover anything not expressed in the SGML declaration and DTD.
There have previously been suggestions that it might generate warnings about other errors in a document in the future. If this were to happen, then it might, for example, detect the use of intrinsic events without a default scripting language.
It's not a serious bug or something that necessarily create design flaws in browsers, but if you want to have really valid webpages you should also validate them strictly using the DTD.
Well... i don't think chris doesn't know about this.. and there is a reason why MyBB haven't added it.
At the end of the day, the W3C are the guys who invented HTML and who currently regulate HTML and XHTML, so if their validator says it is fine, that is that.
DrPoodle Wrote:At the end of the day, the W3C are the guys who invented HTML and who currently regulate HTML and XHTML, so if their validator says it is fine, that is that.

Please read my post, escpecially the last part where it is said
Quote:The W3C validator [...] cannot be expected to cover anything not expressed in the SGML declaration and DTD. [...]
If this were to happen, then it might, for example, detect the use of intrinsic events without a default scripting language.

The W3C's validator just can't do so. As I already said, it is all in the W3C guidlines and DTDs so your comment absolutely paradox.
This bug has been fixed in the latest code.

Please note the latest code is not live on the site or for download. An update will be released in 1.4 which contains this fix.