Re: Nested Items in <HEAD> Element

On Dec 21, 2011, at 12:06 PM, Sandhaus, Evan wrote:

> I am currently advising a number of teams on the implementation of 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?

I haven't tested it, but you might be able to do this with @itemref:

<head>
  <meta itemscope itemtype="http://schema.org/Person" itemref="#name"/>
  <meta id="name" itemprop="name" content="Evan Sandhaus"/>
</head>

Gregg

> Thanks!
> 
> ~Evan

Received on Wednesday, 21 December 2011 20:56:06 UTC