W3C home > Mailing lists > Public > public-vocabs@w3.org > December 2011

Re: Nested Items in <HEAD> Element

From: Sandhaus, Evan <sandhes@nytimes.com>
Date: Wed, 21 Dec 2011 16:22:22 -0500
To: Jeni Tennison <jeni@jenitennison.com>, public-vocabs <public-vocabs@w3.org>
Message-ID: <1DF32BB4-F698-48C4-80BD-71A466813013@nytimes.com>
Jeni,

An excellent question.

My rationale is as follows.  Many publishers, including The Times, annotate articles with descriptive metadata such as people, places, organizations and descriptors (e.g. Politics and Government).   These annotations are tremendously helpful for searching through news archives, but do not always need to be displayed to the user.

Placing such things in the <BODY> is possible, but I am concerned that excessive use of the <META> in <BODY> trick might be interpreted as cloaking.    Which is why I'd prefer to place this markup in the <HEAD>.

The ability to nest <META> tags as hinted in bug 14112 (https://www.w3.org/Bugs/Public/show_bug.cgi?id=14112) would completely solve this problem.  I will post a new bug to raise this issue.

All the best,
Evan
--
Evan Sandhaus
Lead Architect, Semantic Platforms
The New York Times Company
@kansandhaus

On Dec 21, 2011, at 3:57 PM, Jeni Tennison wrote:

Evan,

Why not use <meta> and <link> elements in the <body>, within <div>s that provide you with whatever structure you need? Why do you want to put the <link> and <meta> elements within <head>?

BTW, I think that this is the same as bug 14112 [1] which Hixie closed for lack of information. If you have a good use case then it might be worth reopening that bug or raising a new one.

Cheers,

Jeni

[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=14112

On 21 Dec 2011, at 20:06, Sandhaus, Evan wrote:

I am currently advising a number of teams on the implementation of Schema.org<http://Schema.org> markup and I've encountered an issue with nested metadata in the <HEAD> element.

Suppose you have a 'NewsArticle' document to which you have added an 'itemscope' to the <HTML> element.  Lets further suppose that you want to add some non-visible metadata to the <head> element, say the word count.  To do this you'd code up something like:

<html itemscope itemtype='http://schema.org/NewsArticle">
<head>
<meta itemprop="wordCount" content="1138"/>
...

So far so good, but now suppose we want to add another bit of non-visible metadata to the <head>, but this time we want to add a 'Person' object.

This is where the problem comes in.  Inserting a 'Person' object requires that we nest tags and  it isn't legal in HTML to nest <meta> tags.   Only a  few tags are legal in the scope of <HEAD>.   These tags are <TITLE>, <BASE>, <LINK>, <META>, and <STYLE>.  The problem with this is that none of these tags are permitted to have child tags and you can't express that a 'http://schema.org/NewsItem' object is 'about' a 'http://schema.org/Person' without nesting tags.    In HTML 4 but not HTML 5 the <OBJECT> element is legal in the <HEAD>.

So what can I do?  Is there any valid HTML 5 way to express the following (where nestable is the hypothetical name of an element that doesn't make this illegal )?


<html itemscope itemtype='http://schema.org/NewsArticle">
<head>
<meta itemprop="wordCount" content="1138"/>
<nestable itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="Evan Sandhaus"/>
</nestable>
      ....
</head>
...
</html>

If it is not possible to do this, how would you suggest I proceed?

Thanks!

~Evan

--
Jeni Tennison
http://www.jenitennison.com
Received on Wednesday, 21 December 2011 21:22:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 06:48:58 GMT