W3C validation errors - html

I am getting several validation errors regarding a website using drupal, coming from this section of the page:
<html lang="en" dir="ltr"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:og="http://ogp.me/ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:sioc="http://rdfs.org/sioc/ns#"
xmlns:sioct="http://rdfs.org/sioc/types#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
<head>
The following validation errors:
Line 11, Column 48: Attribute xmlns:content not allowed here.
Line 11, Column 48: Attribute xmlns:dc not allowed here
Line 11, Column 48: Attribute xmlns:foaf not allowed here.
Line 11, Column 48: Attribute xmlns:og not allowed here.
Line 11, Column 48: Attribute xmlns:rdfs not allowed here.
etc....
Anyone ever experience this with drupal or any other site?

From the symptoms, it seems that you are validating against HTML5, probably using <!DOCTYPE html>. The W3C validator validates against the rules of HTML serialization (HTML syntax), where attributes like xmlns:content are invalid. There is no namespace concept, so any : in an attribute name is just yet another character with no special meaning, and such names have not been defined.
Using http://validator.nu/ you can select, in the “Preset” dropdown, XML serialization of HTML5, known as XHTML5. Then you need to follow all XML rules as well as HTML5 rules, and you need to include the attribute xmlns="http://www.w3.org/1999/xhtml" in the <html> tag.

Related

Meta tag 'there is no attribute “class” ' and 'there is no attribute “property” 'and other attribute error

I tried to validate my website and I get the following error :
there is no attribute "class"
<aside class="left-off-canvas-menu">
element "aside" undefined
<aside class="left-off-canvas-menu">
there is no attribute "property"
<meta property="og:title" content="Growth Scorecard" />
document type does not allow element "div" here
…+' preptimeline timeline-portion" title="'+titles[parseInt(val)-1]+'"></div>');
How can I solve this error please suggest to me. I have less knowledge of XHTML. please let me know. why an error occurs on my website.
You can see validator's error report.
The elements and attributes you are using were introduced in HTML 5.
XHTML 1.0 Transitional is too old to support them.
Use HTML 5 instead. It better reflects what browsers actually support and what you are trying to do.

how much important html5 validate for Microdata and how can I fix them?

I checked my webpage on a html5 validator and I got 3 types of errors:
Error1: Attribute name not allowed on element link at this point.
From line 19, column 5; to line 19, column 56
!" />↩ <link name="twitter:url" href="http://localhost/" />↩
Error2: Element link is missing one or more of the following attributes: itemprop, property, rel.
From line 19, column 5; to line 19, column 56
!" />↩ <link name="twitter:url" href="http://localhost/" />
Error3: Element meta not allowed as child of element ul in this context. (Suppressing further errors from this subtree.)
From line 1506, column 19; to line 1506, column 72
<meta itemprop="itemListOrder" content="Descending" />↩
Error 1
Whatever that name attribute is that you stuck in the link tag isn't allowed. Perhaps one or more browsers implement non-standard extensions that make this do something (possibly each does a different thing). Other browsers will likely ignore it.
Error 2
Your link tag is doesn't have itemprop, property, or rel attributes. It seems fairly likely that most software will simply ignore the link tag altogether. Some software may use the link for something despite the fact that part of it is missing. If I write a browser, a link tag missing these attributes will cause your website to display a rickroll and nothing else.
Error 3
You stuck a meta tag under a ul one. It seems likely in this context that you may be targeting some browser that uses that for something (I have no clue what). Other browsers will likely either ignore it or use it to do something else you weren't intending.

Google +1 code validation error: missing attribute

My code: <g:plusone annotation="inline"></g:plusone>
I get this error:
there is no attribute "annotation"
element "g:plusone" undefined
Why?
You have two choices
Change to using this style markup <div class="g-plusone" data-size="tall" ... ></div>
Add the XML NS for google's <g: syntax to the <html tag of the document. Now if only Google would share where that xml namespace is located... (So really, just try option 1)
There is no attribute called "annotation" for any element recommended in the W3C standards. Google probably uses it to parse for some backend processing. If you want the +1 element, you cannot have a W3C standards code.
Check this thread. So what if custom HTML attributes aren't valid XHTML?

Html "Already defined" Error

I am debugging a layout right now and have come across some strange errors. and I am serving the page up as DTD XHTML 1.0 Strict.
The error shows is like this
ID "OFFICENAME" already defined:
div class="office" id="officename"
ID "OFFICENAME" first defined here
span id="officename">
and
NET-enabling start-tag requires SHORTTAG YES
This error is showing in the break code
<br />
Please any one help me out of this and tell me the correct way of representing
id must be unique. You can't have two elements with the same ID. You should remove one of the ids or use class instead. You can have multiple classes on any given element, e.g.:
class="office officename"
In HTML/SGML meaning of / is different than in XHTML: <foo/bar/ is <foo>bar</foo> and <foo/> is <foo></foo>> (that's an archaic quirk supported only by W3C validator).
You're probably sending XHTML markup as HTML. Use text/html MIME type with HTML5 DOCTYPE instead (you'll get better compatiblity, better validation and /> talismans will be allowed).
<!DOCTYPE html>
You can't have multiple elements with the same id. Change the id on the span or the div to something else.

W3 Validation errors

I have 12 errors, but some are just pure non existent. I'm using the smarty templating engine.
Doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Here's the error report, but the "duplicate specification of attribute "value"" simply isn't true according to my .tpl: jsfiddle of .tpl here
{textfield class="quetext" value="Epost*" onblur="if(this.value=='')
this.value='Epost*';"
onfocus="if(this.value=='Epost*') this.value='';"}
Also, does a textarea require the attribute "rows" and "cols"? I thought that was only for tables?
And I don't understand what the two errors at the end mean:
Line 586, Column 80: Attribute value redefined...
Please help!
Thanks :)
(Sorry if things chop and change, I'm working on the valdiation now, to tidy up as many errors as possible.)
the "duplicate specification of attribute "value"" simply isn't true according to my .tpl:
The validator is only looking at your output. You have the value attribute in there twice, no matter what you .tpl says.
Also, does a textarea require the attribute "rows" and "cols"?
Yes
I thought that was only for tables?
Tables don't have those attributes at all
Line 586, Column 80: Attribute value redefined...
You have, in essence: <foo value="something" value="something">
This is the same problem as before, except it is the error on the second one rather than the first.