Everybody knows about microdata, but nobody knows how and when to use it properly. After searching through different StackOverflow questions and Google results I came up with following structure.
<nav itemscope itemtype="http://schema.org/SiteNavigationElement">
<ul itemscope itemtype="http://schema.org/ItemList">
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<meta itemprop="position" content="1">
<a href="http://example.com/page1" itemprop="url">
<span itemprop="name">Page 1</span>
</a>
</li>
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<meta itemprop="position" content="2">
<a href="http://example.com/page2" itemprop="url">
<span itemprop="name">Page 2</span>
</a>
<ul itemscope itemtype="http://schema.org/ItemList">
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<meta itemprop="position" content="1">
<a href="http://example.com/page2-1" itemprop="url">
<span itemprop="name">Page 2-1</span>
</a>
</li>
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<meta itemprop="position" content="2">
<a href="http://example.com/page2-2" itemprop="url">
<span itemprop="name">Page 2-2</span>
</a>
</li>
</ul>
</li>
</ul>
</nav>
The only problem that I have is that I'm getting "Multiple ItemList markups on a page are not allowed" error from Google Testing Tool: https://search.google.com/structured-data/testing-tool
Every other schema.org validator is fine with this. Is there mistake in my code or in Google Tool?
Update: it seems that Google just doesn't like that there is several item-list on the page. That's definetely against schema.org standarts. If I place this code two times I get the same error.
<ul itemscope itemtype="http://schema.org/ItemList">
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<meta itemprop="position" content="1">
<a title="Page 1" href="http://example.com/page1" itemprop="url">
<span itemprop="name">Page 1</span>
</a>
</li>
</ul>