[html5] r3080 - [e] (0) More microdata intro text.
whatwg at whatwg.org
whatwg at whatwg.org
Sun May 10 20:47:11 PDT 2009
Author: ianh
Date: 2009-05-10 20:47:10 -0700 (Sun, 10 May 2009)
New Revision: 3080
Modified:
index
source
Log:
[e] (0) More microdata intro text.
Modified: index
===================================================================
--- index 2009-05-11 00:15:26 UTC (rev 3079)
+++ index 2009-05-11 03:47:10 UTC (rev 3080)
@@ -39,7 +39,7 @@
<div class=head>
<p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
<h1>HTML 5</h1>
- <h2 class="no-num no-toc" id=draft-recommendation-—-date:-01-jan-1901>Draft Recommendation — 10 May 2009</h2>
+ <h2 class="no-num no-toc" id=draft-recommendation-—-date:-01-jan-1901>Draft Recommendation — 11 May 2009</h2>
<p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<dl><dt>Multiple-page version:</dt>
@@ -668,7 +668,8 @@
<li><a href=#introduction-2><span class=secno>5.1 </span>Introduction</a>
<ol>
<li><a href=#the-basic-syntax><span class=secno>5.1.1 </span>The basic syntax</a></li>
- <li><a href=#defining-vocabularies><span class=secno>5.1.2 </span>Defining vocabularies</a></ol></li>
+ <li><a href=#typed-items><span class=secno>5.1.2 </span>Typed items</a></li>
+ <li><a href=#selecting-names-when-defining-vocabularies><span class=secno>5.1.3 </span>Selecting names when defining vocabularies</a></ol></li>
<li><a href=#encoding-microdata><span class=secno>5.2 </span>Encoding microdata</a>
<ol>
<li><a href=#the-microdata-model><span class=secno>5.2.1 </span>The microdata model</a></li>
@@ -40653,9 +40654,8 @@
</div>
<p>Properties can also have values that are dates, times, or dates
- and times. This is achieved using the <code title="">time</code>
- element and its <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code>
- attribute.</p>
+ and times. This is achieved using the <code><a href=#the-time-element>time</a></code> element and
+ its <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> attribute.</p>
<div class=example>
@@ -40679,24 +40679,132 @@
<pre><div item>
<p>Name: <span property="name">Amanda</span></p>
- <p>Band: <span property="band" item> <span property="name">Jazz Band</span> (<span property="size">12</span> players)</span></span></p>
+ <p>Band: <span property="band" item> <span property="name">Jazz Band</span> (<span property="size">12</span> players)</span></p>
</div></pre>
<p>In this example, the outer item has two properties, "name" and
- "band". The "name" is "Amanda",and the "band" is an item in its own
+ "band". The "name" is "Amanda", and the "band" is an item in its own
right, with two properties, "name" and "size". The "name" of the
band is "Jazz Band", and the "size" is "12".</p>
</div>
-
+ <p>Properties don't have to be given as ancestors of the element
+ with the <code title=attr-item><a href=#items:-the-item-attribute>item</a></code> attribute. They can be
+ associated with a specific <a href=#concept-item title=concept-item>item</a>
+ using the <code title=attr-subject><a href=#attr-subject>subject</a></code> attribute, which
+ takes the ID of the element with the <code title=attr-item><a href=#items:-the-item-attribute>item</a></code> attribute.</p>
+ <div class=example>
+ <p>This example is the same as the previous one, but all the
+ properties are separated from their <a href=#concept-item title=concept-item>items</a>:</p>
- <h4 id=defining-vocabularies><span class=secno>5.1.2 </span>Defining vocabularies</h4>
+ <pre><div item id="amanda"></div>
+<div subject="amanda" property="band" item id="jazzband"></div>
+<p>Name: <span subject="amanda" property="name">Amanda</span></p>
+<p>Band: <span subject="jazzband" property="name">Jazz Band</span></p>
+<p>Size: <span subject="jazzband" property="size">12</span> players</p></pre>
+ <p>This gives the same result as the previous example. The first
+ item has two properties, "name", set to "Amanda", and "band", set
+ to another item. That second item has two further properties,
+ "name", set to "Jazz Band", and "size", set to "12".</p>
+
+ </div>
+
+ <p>An <a href=#concept-item title=concept-item>item</a> can have multiple
+ properties with the same name and different values.</p>
+
+ <div class=example>
+
+ <p>This example describes an ice cream, with two flavors:</p>
+
+ <pre><div item>
+ <p>Flavors in my favorite ice cream:</p>
+ <ul>
+ <li property="flavor">Lemon sorbet</li>
+ <li property="flavor">Apricot sorbet</li>
+ </ul>
+</div></pre>
+
+ <p>This thus results in an item with two properties, both "flavor",
+ having the values "Lemon sorbet" and "Apricot sorbet".</p>
+
+ </div>
+
+ <p>An element introdicing a property can also introduce multiple
+ properties at once, to avoid duplication when some of the properties
+ have the same value.</p>
+
+ <div class=example>
+
+ <p>Here we see an item with two properties, "favorite-color" and
+ "favorite-fruit", both set to the value "orange":</p>
+
+ <pre><div item>
+ <span property="favorite-color favorite-fruit">orange</span>
+</div></pre>
+
+ </div>
+
+
+
+ <h4 id=typed-items><span class=secno>5.1.2 </span>Typed items</h4>
+
<p><em>This section is non-normative.</em></p>
+ <p>The examples in the previous section show how information could
+ be marked up on a page that doesn't expect its microdata to be
+ re-used. Microdata is most useful, though, when it is used in
+ contexts where other authors and readers are able to cooperate to
+ make new uses of the markup.</p>
+
+ <p>For this purpose, it is necessary to give each <a href=#concept-item title=concept-item>item</a> a type, such as "person", or "cat",
+ or "band". Types are identified in three ways:</p>
+
+ <ul class=brief><li>As <a href=#url title=URL>URLs</a>
+
+ <li>As <a href=#valid-reversed-dns-identifier title="valid reversed DNS identifier">reversed DNS
+ labels</a>
+
+<!--
+ <li>Using the names of <span>predefined types</span>
+-->
+
+ </ul><p><a href=#url title=URL>URLs</a> are self-explanatory. <a href=#valid-reversed-dns-identifier title="valid reversed DNS identifier">Reversed DNS labels</a> are
+ strings such as "org.example.animals.cat" or "org.example.band".</p>
+
+ <p>The type for an <a href=#concept-item title=concept-item>item</a> is given
+ as the value of the <code title=attr-item><a href=#items:-the-item-attribute>item</a></code>
+ attribute.</p>
+
+ <div class=example>
+
+ <p>Here, the item is "org.example.animals.cat":</p>
+
+<pre><section item="org.example.animal.cat">
+ <h1 property="org.example.name">Hedral</h1>
+ <p property="org.example.desc">Hedral is a male american domestic
+ shorthair, with a fluffy black fur with white paws and belly.</p>
+ <img property="org.example.img" src="hedral.jpeg" alt="" title="Hedral, age 18 months">
+</section></pre>
+
+ </div>
+
+ <p>When using custom typed items, the property names are also given
+ in this form.</p>
+
+<!--
+ <p><span>Predefined types</span> are described below.</p>
+-->
+
+
+
+ <h4 id=selecting-names-when-defining-vocabularies><span class=secno>5.1.3 </span>Selecting names when defining vocabularies</h4>
+
+ <p><em>This section is non-normative.</em></p>
+
<p>Using microdata means using a vocabulary. For some purposes, an
ad-hoc vocabulary is adequate. For others, a vocabulary will need to
be designed. Where possible, authors are encouraged to re-use
@@ -40723,7 +40831,6 @@
-
<h3 id=encoding-microdata><span class=secno>5.2 </span>Encoding microdata</h3>
<h4 id=the-microdata-model><span class=secno>5.2.1 </span>The microdata model</h4>
Modified: source
===================================================================
--- source 2009-05-11 00:15:26 UTC (rev 3079)
+++ source 2009-05-11 03:47:10 UTC (rev 3080)
@@ -45871,9 +45871,8 @@
</div>
<p>Properties can also have values that are dates, times, or dates
- and times. This is achieved using the <code title="">time</code>
- element and its <code title="attr-time-datetime">datetime</code>
- attribute.</p>
+ and times. This is achieved using the <code>time</code> element and
+ its <code title="attr-time-datetime">datetime</code> attribute.</p>
<div class="example">
@@ -45897,24 +45896,140 @@
<pre><div item>
<p>Name: <span property="name">Amanda</span></p>
- <p>Band: <span property="band" item> <span property="name">Jazz Band</span> (<span property="size">12</span> players)</span></span></p>
+ <p>Band: <span property="band" item> <span property="name">Jazz Band</span> (<span property="size">12</span> players)</span></p>
</div></pre>
<p>In this example, the outer item has two properties, "name" and
- "band". The "name" is "Amanda",and the "band" is an item in its own
+ "band". The "name" is "Amanda", and the "band" is an item in its own
right, with two properties, "name" and "size". The "name" of the
band is "Jazz Band", and the "size" is "12".</p>
</div>
-
+ <p>Properties don't have to be given as ancestors of the element
+ with the <code title="attr-item">item</code> attribute. They can be
+ associated with a specific <span title="concept-item">item</span>
+ using the <code title="attr-subject">subject</code> attribute, which
+ takes the ID of the element with the <code
+ title="attr-item">item</code> attribute.</p>
+ <div class="example">
+ <p>This example is the same as the previous one, but all the
+ properties are separated from their <span
+ title="concept-item">items</span>:</p>
- <h4>Defining vocabularies</h4>
+ <pre><div item id="amanda"></div>
+<div subject="amanda" property="band" item id="jazzband"></div>
+<p>Name: <span subject="amanda" property="name">Amanda</span></p>
+<p>Band: <span subject="jazzband" property="name">Jazz Band</span></p>
+<p>Size: <span subject="jazzband" property="size">12</span> players</p></pre>
+ <p>This gives the same result as the previous example. The first
+ item has two properties, "name", set to "Amanda", and "band", set
+ to another item. That second item has two further properties,
+ "name", set to "Jazz Band", and "size", set to "12".</p>
+
+ </div>
+
+ <p>An <span title="concept-item">item</span> can have multiple
+ properties with the same name and different values.</p>
+
+ <div class="example">
+
+ <p>This example describes an ice cream, with two flavors:</p>
+
+ <pre><div item>
+ <p>Flavors in my favorite ice cream:</p>
+ <ul>
+ <li property="flavor">Lemon sorbet</li>
+ <li property="flavor">Apricot sorbet</li>
+ </ul>
+</div></pre>
+
+ <p>This thus results in an item with two properties, both "flavor",
+ having the values "Lemon sorbet" and "Apricot sorbet".</p>
+
+ </div>
+
+ <p>An element introdicing a property can also introduce multiple
+ properties at once, to avoid duplication when some of the properties
+ have the same value.</p>
+
+ <div class="example">
+
+ <p>Here we see an item with two properties, "favorite-color" and
+ "favorite-fruit", both set to the value "orange":</p>
+
+ <pre><div item>
+ <span property="favorite-color favorite-fruit">orange</span>
+</div></pre>
+
+ </div>
+
+
+
+ <h4>Typed items</h4>
+
<p><em>This section is non-normative.</em></p>
+ <p>The examples in the previous section show how information could
+ be marked up on a page that doesn't expect its microdata to be
+ re-used. Microdata is most useful, though, when it is used in
+ contexts where other authors and readers are able to cooperate to
+ make new uses of the markup.</p>
+
+ <p>For this purpose, it is necessary to give each <span
+ title="concept-item">item</span> a type, such as "person", or "cat",
+ or "band". Types are identified in three ways:</p>
+
+ <ul class="brief">
+
+ <li>As <span title="URL">URLs</span>
+
+ <li>As <span title="valid reversed DNS identifier">reversed DNS
+ labels</span>
+
+<!--
+ <li>Using the names of <span>predefined types</span>
+-->
+
+ </ul>
+
+ <p><span title="URL">URLs</span> are self-explanatory. <span
+ title="valid reversed DNS identifier">Reversed DNS labels</span> are
+ strings such as "org.example.animals.cat" or "org.example.band".</p>
+
+ <p>The type for an <span title="concept-item">item</span> is given
+ as the value of the <code title="attr-item">item</code>
+ attribute.</p>
+
+ <div class="example">
+
+ <p>Here, the item is "org.example.animals.cat":</p>
+
+<pre><section item="org.example.animal.cat">
+ <h1 property="org.example.name">Hedral</h1>
+ <p property="org.example.desc">Hedral is a male american domestic
+ shorthair, with a fluffy black fur with white paws and belly.</p>
+ <img property="org.example.img" src="hedral.jpeg" alt="" title="Hedral, age 18 months">
+</section></pre>
+
+ </div>
+
+ <p>When using custom typed items, the property names are also given
+ in this form.</p>
+
+<!--
+ <p><span>Predefined types</span> are described below.</p>
+-->
+
+
+
+ <h4>Selecting names when defining vocabularies</h4>
+
+ <p><em>This section is non-normative.</em></p>
+
<p>Using microdata means using a vocabulary. For some purposes, an
ad-hoc vocabulary is adequate. For others, a vocabulary will need to
be designed. Where possible, authors are encouraged to re-use
@@ -45944,7 +46059,6 @@
-
<h3>Encoding microdata</h3>
<h4>The microdata model</h4>
More information about the Commit-Watchers
mailing list