Elxis CMS Forum

Support => General => Topic started by: nikos on April 04, 2013, 15:50:51

Title: Elxis 4.x site - HTML Validation
Post by: nikos on April 04, 2013, 15:50:51
I was checking an Elxis 4.x site i have created for it's HTML validation by the known service site http://validator.w3.org/ and it gives me 2 errors regarding the meta tags which as i noticed are identical with the 2 errors it gives checking the site https://www.elxis.net/

Code: [Select]

Error Line 5, Column 52: Using the meta element to specify the document-wide default language is obsolete. Consider specifying the language on the root element instead.

<meta http-equiv="content-language" content="en" />

Error Line 7, Column 46: Bad value distribution for attribute name on element meta: Keyword distribution is not registered.

<meta name="distribution" content="global" />

Syntax of metadata name:
    A metadata name listed in the HTML specification or listed in the WHATWG wiki. You can register metadata names on the WHATWG wiki yourself.


So i was wondering what has to be changed on above 2 points for making it 100% valid.

Note: In general settings i have set HTML 5 as Document type, which is the recomended option.
Title: Re: Elxis 4.x site - HTML Validation
Post by: datahell on April 04, 2013, 19:06:58
They are not problem but I you want to get rid of these open the file below and comment lines 88 and 90
includes/libraries/elxis/document.class.php
Title: Re: Elxis 4.x site - HTML Validation
Post by: nikos on April 05, 2013, 23:49:14
The test for me passed as 100% valid, commenting lines 86 and 88 (line 90 is blank).

Code: [Select]

Line 86: $this->meta['http-equiv']['content-language'] = $eLang->getinfo('LANGUAGE');

Line 88: $this->meta['standard']['distribution'] = 'global';


Note: Under validation there is a note saying...

"Using experimental feature: HTML5 Conformance Checker.

The validator checked your document with an experimental feature: HTML5 Conformance Checker. This feature has been made available for your convenience, but be aware that it may be unreliable, or not perfectly up to date with the latest development of some cutting-edge technologies. If you find any issues with this feature, please report them. Thank you.
"

So can we suppose, by the the above note, that in future may pass the test as 100% valid without to have comment the above lines?

Thanks in any case for your reply.
Title: Re: Elxis 4.x site - HTML Validation
Post by: datahell on April 06, 2013, 09:18:13
When you perform a validation you must know why you do something like that.
A meta tag is never a problem even if it doesn't conform to the standards. Even if you add a non existent meta it wont be a problem, for example:
<meta something="custom" />
The browser or the web spider will simply ignore that.
The same for the many google-based tags users add on their head section.

Why we do validations? Mostly because we don't want parsing errors on the body section and on some important head elements. Also to find any non-matching tags (important) and to achieve the maximum browser compatibility. We want to make sure the document will be displayed correctly in all browsers and our javascript and css will work fine.

In your case you have an obsolete (for HTML5 only) meta tag regarding "content-language". Even if the browser ignore that it's ok as the language is properly defined in the html start tag, <html lang="en">.

The distribution is an old recommendation which never used as it should, and it can be removed and it is also not problem if you leave it there.

For such cases you can ignore the validators.
BTW, have you ever validated sites such as microsoft.com or google.com? Do it and you might start to understand the game behind the web standards...

Finally, something which is the key element in validation. When you validate something you do that against what? Which is the comparison element? A document standard. Which is that? The head line before the <html> start tag. For HTML5 this is just "<!doctype html>". But do you know that you can load your own specifications there? Example:
<!DOCTYPE HTML SYSTEM "http://www.example.com/mydtd.dtd">
The "HTML" in the above declaration is the element your dtd applies to. In our case in the whole html document. "SYSTEM" means that this is an external doctype.
In your "mydtd.dtd" you might declare a new html tag like "elxis" and make valid the use of this:
<elxis>something</elxis>
In CSS you could write something like:
elxis { display:block; font-weight:bold; }

In this case the validator should find the document as valid if it validates it against the dtd you declared.