thabemmz
thabemmz

Reputation: 131

Nested microdata itemscope without itemprop

For a microdata parser I'm writing I parsed the following (simplified) html source:

<html itemscope itemtype="http://schema.org/Article" class="no-js" lang="nl">
  <head>
    <meta itemprop="name" content="Some article name">
  </head>
  <body>
    <div itemscope itemtype="http://schema.org/Movie">
      <span itemprop="name">Skyfall</span>
    </div>
  </body>
</html>

Couple of questions about this:

  1. Is this a valid implementation following the W3c spec? I couldn't find anything in the spec itself, but don't know if its a common pattern.
  2. How should I read this microdata? Are we dealing with an Article that contains a Movie? Or with two microdata items - an Article and a Movie?

Any help would be appreciated.

Upvotes: 1

Views: 427

Answers (1)

unor
unor

Reputation: 96527

When providing the DOCTYPE and the missing title element, this is valid HTML5+Microdata.

The Article and the Movie in your example have no relation, so these are two separate top-level items:

Article
name: "Some article name"

Movie
name: "Skyfall"

Items are only related via itemprop, not by plain HTML-level nesting.

For example, using the about property as in:

<div itemscope itemtype="http://schema.org/Article">
  <h1 itemprop="name">Some article name</h1>
  <div itemprop="about" itemscope itemtype="http://schema.org/Movie">
    <span itemprop="name">Skyfall</span>
  </div>
</div>

would result in:

Article
name: "Some article name"
about: 
    Movie
    name: "Skyfall"

Upvotes: 2

Related Questions