[whatwg] Issues with microdata and proposals for improvements
Tab Atkins Jr.
jackalmage at gmail.com
Fri Oct 12 09:43:29 PDT 2012
On Fri, Oct 12, 2012 at 7:28 AM, pghj <pghjvanblokland at gmail.com> wrote:
> == Incompatible property names when using itemrefs ==
>
> Consider the following piece of HTML:
>
> <div itemscope itemtype="http://schema.org/Book" itemref="a"> ... </div>
> <div itemscope itemtype="http://schema.org/LiteraryEvent" itemref="b">
> ... </div>
> <div id="a" itemprop="author" itemscope
> itemtype="http://schema.org/Person" itemref="c"></div>
> <div id="b" itemprop="performer" itemscope
> itemtype="http://schema.org/Person" itemref="c"></div>
> <div id="c">
> Name: <span itemprop="name">Amanda</span>
> </div>
>
> Actually, the 'Book' item and the 'LiteraryEvent' item both want to
> refer to the same person: the first as the author, the second as a
> performer. Because the property names differ, I can't seem to find a
> proper way to do this using itemrefs, without either polluting other
> items, or creating two 'Person' items (as I did above). Both
> approaches are undesirable.
You can put more than one property in a single itemprop attribute.
Just drop #a and #b, move the itemscope to #c, and put
itemprop="performer author" on it.
~TJ
More information about the whatwg
mailing list