Skip to content

Commit

Permalink
[e] (0) Microdata: add an example of multiple types.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@6686 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 14, 2011
1 parent d2eb0e5 commit 0006e9b
Show file tree
Hide file tree
Showing 3 changed files with 246 additions and 0 deletions.
80 changes: 80 additions & 0 deletions complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -57977,6 +57977,86 @@ <h4 id=items><span class=secno>5.2.2 </span>Items</h4>
so that each column defines a separate <a href=#concept-item title=concept-item>item</a>, while keeping the properties in
the cells.</p>

<div class=example>

<p>This example shows a simple vocabulary used to describe the
products of a model railway manufacturer. The vocabulary has just
five property names:</p>

<dl><dt>product-code</dt>
<dd>An integer that names the product in the manufacturer's catalog.</dd>
<dt>name</dt>
<dd>A brief description of the product.</dd>
<dt>scale</dt>
<dd>One of "HO", "1", or "Z" (potentially with leading or trailing
whitespace), indicating the scale of the product.</dd>
<dt>digital</dt>
<dd>If present, one of "Digital", "Delta", or "Systems"
(potentially with leading or trailing whitespace) indicating that
the product has a digital decoder of the given type.</dd>
<dt>track-type</dt>
<dd>For track-specific products, one of "K", "M", "C" (potentially
with leading or trailing whitespace) indicating the type of track
for which the product is intended.</dd>
</dl><p>This vocabulary has four defined <a href=#item-types>item types</a>:</p>

<dl><dt>http://md.example.com/loco</dt>
<dd>Rolling stock with an engine</dd>
<dt>http://md.example.com/passengers</dt>
<dd>Passenger rolling stock</dd>
<dt>http://md.example.com/track</dt>
<dd>Track pieces</dd>
<dt>http://md.example.com/lighting</dt>
<dd>Equipment with lighting</dd>
</dl><p>Each <a href=#concept-item title=concept-item>item</a> that uses this
vocabulary can be given one or more of these types, depending on
what the product is.</p>

<p>Thus, a locomotive might be marked up as:</p>

<pre>&lt;dl itemscope itemtype="http://md.example.com/loco
http://md.example.com/lighting"&gt;
&lt;dt&gt;Name:
&lt;dd itemprop="name"&gt;Tank Locomotive (DB 80)
&lt;dt&gt;Product code:
&lt;dd itemprop="product-code"&gt;33041
&lt;dt&gt;Scale:
&lt;dd itemprop="scale"&gt;HO
&lt;dt&gt;Digital:
&lt;dd itemprop="digital"&gt;Delta
&lt;/dl&gt;</pre>

<p>A turnout lantern retrofit kit might be marked up as:</p>

<pre>&lt;dl itemscope itemtype="http://md.example.com/track
http://md.example.com/lighting"&gt;
&lt;dt&gt;Name:
&lt;dd itemprop="name"&gt;Turnout Lantern Kit
&lt;dt&gt;Product code:
&lt;dd itemprop="product-code"&gt;74470
&lt;dt&gt;Purpose:
&lt;dd&gt;For retrofitting 2 &lt;span itemprop="track-type"&gt;C&lt;/span&gt; Track
turnouts. &lt;meta itemprop="scale" content="HO"&gt;
&lt;/dl&gt;</pre>

<p>A passenger car with no lighting might be marked up as:</p>

<pre>&lt;dl itemscope itemtype="http://md.example.com/passengers"&gt;
&lt;dt&gt;Name:
&lt;dd itemprop="name"&gt;Express Train Passenger Car (DB Am 203)
&lt;dt&gt;Product code:
&lt;dd itemprop="product-code"&gt;8710
&lt;dt&gt;Scale:
&lt;dd itemprop="scale"&gt;Z
&lt;/dl&gt;</pre>

<p>Great care is necessary when creating new vocabularies. Often, a
hierarchical approach to types can be taken that results in a
vocabulary where each item only ever has a single type, which is
generally much simpler to manage.</p>

</div>


<h4 id=names:-the-itemprop-attribute><span class=secno>5.2.3 </span>Names: the <dfn title=attr-itemprop><code>itemprop</code></dfn> attribute</h4>

Expand Down
80 changes: 80 additions & 0 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -57977,6 +57977,86 @@ document.body.appendChild(outer);</pre>
so that each column defines a separate <a href=#concept-item title=concept-item>item</a>, while keeping the properties in
the cells.</p>

<div class=example>

<p>This example shows a simple vocabulary used to describe the
products of a model railway manufacturer. The vocabulary has just
five property names:</p>

<dl><dt>product-code</dt>
<dd>An integer that names the product in the manufacturer's catalog.</dd>
<dt>name</dt>
<dd>A brief description of the product.</dd>
<dt>scale</dt>
<dd>One of "HO", "1", or "Z" (potentially with leading or trailing
whitespace), indicating the scale of the product.</dd>
<dt>digital</dt>
<dd>If present, one of "Digital", "Delta", or "Systems"
(potentially with leading or trailing whitespace) indicating that
the product has a digital decoder of the given type.</dd>
<dt>track-type</dt>
<dd>For track-specific products, one of "K", "M", "C" (potentially
with leading or trailing whitespace) indicating the type of track
for which the product is intended.</dd>
</dl><p>This vocabulary has four defined <a href=#item-types>item types</a>:</p>

<dl><dt>http://md.example.com/loco</dt>
<dd>Rolling stock with an engine</dd>
<dt>http://md.example.com/passengers</dt>
<dd>Passenger rolling stock</dd>
<dt>http://md.example.com/track</dt>
<dd>Track pieces</dd>
<dt>http://md.example.com/lighting</dt>
<dd>Equipment with lighting</dd>
</dl><p>Each <a href=#concept-item title=concept-item>item</a> that uses this
vocabulary can be given one or more of these types, depending on
what the product is.</p>

<p>Thus, a locomotive might be marked up as:</p>

<pre>&lt;dl itemscope itemtype="http://md.example.com/loco
http://md.example.com/lighting"&gt;
&lt;dt&gt;Name:
&lt;dd itemprop="name"&gt;Tank Locomotive (DB 80)
&lt;dt&gt;Product code:
&lt;dd itemprop="product-code"&gt;33041
&lt;dt&gt;Scale:
&lt;dd itemprop="scale"&gt;HO
&lt;dt&gt;Digital:
&lt;dd itemprop="digital"&gt;Delta
&lt;/dl&gt;</pre>

<p>A turnout lantern retrofit kit might be marked up as:</p>

<pre>&lt;dl itemscope itemtype="http://md.example.com/track
http://md.example.com/lighting"&gt;
&lt;dt&gt;Name:
&lt;dd itemprop="name"&gt;Turnout Lantern Kit
&lt;dt&gt;Product code:
&lt;dd itemprop="product-code"&gt;74470
&lt;dt&gt;Purpose:
&lt;dd&gt;For retrofitting 2 &lt;span itemprop="track-type"&gt;C&lt;/span&gt; Track
turnouts. &lt;meta itemprop="scale" content="HO"&gt;
&lt;/dl&gt;</pre>

<p>A passenger car with no lighting might be marked up as:</p>

<pre>&lt;dl itemscope itemtype="http://md.example.com/passengers"&gt;
&lt;dt&gt;Name:
&lt;dd itemprop="name"&gt;Express Train Passenger Car (DB Am 203)
&lt;dt&gt;Product code:
&lt;dd itemprop="product-code"&gt;8710
&lt;dt&gt;Scale:
&lt;dd itemprop="scale"&gt;Z
&lt;/dl&gt;</pre>

<p>Great care is necessary when creating new vocabularies. Often, a
hierarchical approach to types can be taken that results in a
vocabulary where each item only ever has a single type, which is
generally much simpler to manage.</p>

</div>


<h4 id=names:-the-itemprop-attribute><span class=secno>5.2.3 </span>Names: the <dfn title=attr-itemprop><code>itemprop</code></dfn> attribute</h4>

Expand Down
86 changes: 86 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -65393,6 +65393,92 @@ document.body.appendChild(outer);</pre>
title="concept-item">item</span>, while keeping the properties in
the cells.</p>

<div class="example">

<p>This example shows a simple vocabulary used to describe the
products of a model railway manufacturer. The vocabulary has just
five property names:</p>

<dl>
<dt>product-code</dt>
<dd>An integer that names the product in the manufacturer's catalog.</dd>
<dt>name</dt>
<dd>A brief description of the product.</dd>
<dt>scale</dt>
<dd>One of "HO", "1", or "Z" (potentially with leading or trailing
whitespace), indicating the scale of the product.</dd>
<dt>digital</dt>
<dd>If present, one of "Digital", "Delta", or "Systems"
(potentially with leading or trailing whitespace) indicating that
the product has a digital decoder of the given type.</dd>
<dt>track-type</dt>
<dd>For track-specific products, one of "K", "M", "C" (potentially
with leading or trailing whitespace) indicating the type of track
for which the product is intended.</dd>
</dl>

<p>This vocabulary has four defined <span>item types</span>:</p>

<dl>
<dt>http://md.example.com/loco</dt>
<dd>Rolling stock with an engine</dd>
<dt>http://md.example.com/passengers</dt>
<dd>Passenger rolling stock</dd>
<dt>http://md.example.com/track</dt>
<dd>Track pieces</dd>
<dt>http://md.example.com/lighting</dt>
<dd>Equipment with lighting</dd>
</dl>

<p>Each <span title="concept-item">item</span> that uses this
vocabulary can be given one or more of these types, depending on
what the product is.</p>

<p>Thus, a locomotive might be marked up as:</p>

<pre>&lt;dl itemscope itemtype="http://md.example.com/loco
http://md.example.com/lighting">
&lt;dt>Name:
&lt;dd itemprop="name">Tank Locomotive (DB 80)
&lt;dt>Product code:
&lt;dd itemprop="product-code">33041
&lt;dt>Scale:
&lt;dd itemprop="scale">HO
&lt;dt>Digital:
&lt;dd itemprop="digital">Delta
&lt;/dl></pre>

<p>A turnout lantern retrofit kit might be marked up as:</p>

<pre>&lt;dl itemscope itemtype="http://md.example.com/track
http://md.example.com/lighting">
&lt;dt>Name:
&lt;dd itemprop="name">Turnout Lantern Kit
&lt;dt>Product code:
&lt;dd itemprop="product-code">74470
&lt;dt>Purpose:
&lt;dd>For retrofitting 2 &lt;span itemprop="track-type">C&lt;/span> Track
turnouts. &lt;meta itemprop="scale" content="HO">
&lt;/dl></pre>

<p>A passenger car with no lighting might be marked up as:</p>

<pre>&lt;dl itemscope itemtype="http://md.example.com/passengers">
&lt;dt>Name:
&lt;dd itemprop="name">Express Train Passenger Car (DB Am 203)
&lt;dt>Product code:
&lt;dd itemprop="product-code">8710
&lt;dt>Scale:
&lt;dd itemprop="scale">Z
&lt;/dl></pre>

<p>Great care is necessary when creating new vocabularies. Often, a
hierarchical approach to types can be taken that results in a
vocabulary where each item only ever has a single type, which is
generally much simpler to manage.</p>

</div>


<h4>Names: the <dfn title="attr-itemprop"><code>itemprop</code></dfn> attribute</h4>

Expand Down

0 comments on commit 0006e9b

Please sign in to comment.