[Bug 13007] should (resolved) itemid be unique within a document?

http://www.w3.org/Bugs/Public/show_bug.cgi?id=13007

--- Comment #11 from Tab Atkins Jr. <jackalmage@gmail.com> 2011-06-22 00:47:34 UTC ---
(In reply to comment #10)
> If you do this:
> 
> <span itemref="foo" itemscope itemtype="http://schema.org/WebPage">
>    <span itemprop="name">My Website and Blog</span>
> </span>
> 
> <span itemref="foo" itemscope itemtype="http://schema.org/BlogPost"> 
>    <a itemprop="url" href="http://example.org/post-4">permalink</a>
> </span>

You're using @itemref wrong.  @itemref takes a list of ids that should also be
trawled for properties.

<span itemscope itemtype="http://schema.org/WebPage" itemref="foo">
  <span itemprop=name>My Website and Blog</span>
</span>

<span id=foo>
  <a itemprop=url href="http://example.org/post-4">permalink</a>
</span>

This produces a single Microdata item with 'name' and 'url' properties, of type
"http://schema.org/WebPage".

If you want two items with different types but the same values, do something
like this:

<meta itemscope itemtype="http://schema.org/WebPage" itemref="foo">
<meta itemscope itemtype="http://schema.org/BlogPost" itemref="foo">
<span id=foo>
  <span itemprop=name>My Website and Blog</span>
  <a itemprop=url href="http://example.org/post-4">permalink</a>
</span>

This will produce two Microdata items, one of each type, both carrying the same
'name' and 'url' properties.  You can give either or both of them an @itemid as
well, if you need to.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 22 June 2011 00:47:37 UTC