4

I use these tags in the head of an HTML5 page, but these cause problems in W3C Validation Keyword is not registered.

<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="description" content="Sitename - My Website" />
<meta name="keywords" content="graphic, security," />
<meta name="author" content="My Name" />
<meta name="identifier-url" content="" />
<meta name="revisit-after" content="14 days" />
<meta name="robots" content="all" />
<meta http-equiv="content-language" content="en" />
<meta name="Language" content="en" />

Same problem also with Dublin Core

<!-- Dublin Core -->
<meta name="DC.Title" content="My Site"/>
<meta name="DC.Subject" content="WebDesign; Analysis"/>
<meta name="DC.Description" content="This is my site bla bla bla"/>
<meta name="DC.Publisher" content="My Name"/>
<meta name="DC.Rights" content="Allrights reserved."/>
<!-- Fine Dublin Core -->

How I could fix this issue? If I delete these parts obviously the site run but I lost useful keywords that could help to better indexing my page.

Any suggestion?

Kjuly
  • 34,476
  • 22
  • 104
  • 118
AndreaF
  • 11,975
  • 27
  • 102
  • 168

2 Answers2

4

These are the standard meta names defined in the HTML5 spec:
http://www.w3.org/TR/2014/REC-html5-20141028/document-metadata.html#standard-metadata-names

Additional names need to be registered at:
http://wiki.whatwg.org/wiki/MetaExtensions

So for HTML5, you are free to use the name values listed on these two links, but values not listed there are not valid.

If you use a registered keyword and a validator reports it as error, the validator is probably not up to date (new keywords can be registered in the wiki at any time).


EDIT: as requested in the comments, a valid example of the use with the name dc.language:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Test</title>
  <meta name="dc.language" content="en">
</head>
<body>
</body>
</html>

You can validate it with http://validator.w3.org/ (using "Direct Input").

Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360
  • I have solved for the meta names, but there isn't a way to include dublin core without lost the W3C validation in HTML5? – AndreaF Oct 12 '12 at 17:57
  • @AndreaF: Dublin Core keywords are listed [in the wiki](http://wiki.whatwg.org/wiki/MetaExtensions#Registered_Extensions), too (like `dc.language`, `dcterms.alternative` etc.) – unor Oct 13 '12 at 00:30
  • I have tried but for Dublin Core doesn't works any of these if I change meta name to dc.language etc., could you give me a working sample? – AndreaF Oct 13 '12 at 00:34
  • @AndreaF: I added a simple example to my answer. – unor Oct 13 '12 at 00:41
3

Your initial method was the right one. The HTML validator has been updated in the meantime and approves of it.

The name attribute in the HTML meta element has a few defined values - see the HTML5 spec -, but any other value is legal, too. So the following code will pass W3C's validator:

<meta name="dc.whatever" content="dunno">

To my knowledge, this is the only HTML5 compliant method to include DC metadata. Both the Dublin Core documentation and WHATWG (referenced by the W3C spec!) recommend the following before using dc values in <meta>:

<link rel="schema.dc" href="http://purl.org/dc/elements/1.1/">

This is, however, not valid. There is a limited set of acceptable values for <link rel="...">, and schema is not among them: HTML5 spec

For the same reason the answer above produces invalid HTML - there is no link type meta. As far as I know, there is no way to include XML into HTML other than <script> (which looks more like a hack to me).

Probably switching to XHTML will be your best bet if you want to use Dublin Core.

Community
  • 1
  • 1
wortwart
  • 3,139
  • 27
  • 31