Clean up attribute definitions and references. Removed @cite processing for block and q
authorGregg Kellogg <gregg@kellogg-assoc.com>
Wed, 26 Oct 2011 13:12:35 -0700
changeset 8 a11c18d7c5f0
parent 7 eb738e010e2a
child 9 b296d3ba308a
Clean up attribute definitions and references. Removed @cite processing for block and q
microdata-rdf/index.html
--- a/microdata-rdf/index.html	Wed Oct 26 12:46:18 2011 -0700
+++ b/microdata-rdf/index.html	Wed Oct 26 13:12:35 2011 -0700
@@ -20,6 +20,7 @@
 
                     // process the document before anything else is done
                     var refs = document.querySelectorAll('adef') ;
+                    var adefs = [];
                     for (var i = 0; i < refs.length; i++) {
                         var item = refs[i];
                         var p = item.parentNode ;
@@ -29,6 +30,12 @@
                         if (!tit) {
                             tit = con;
                         }
+
+                        if ( adefs[tit]) {
+                          throw "Duplicate definition of attribute '" + tit + "'" ;
+                        }
+                        adefs[tit] = sp ;
+
                         sp.className = 'adef' ;
                         sp.title=tit ;
                         sp.innerHTML = con ;
@@ -40,6 +47,9 @@
                         var p = item.parentNode ;
                         var con = item.innerHTML ;
                         var sp = document.createElement( 'a' ) ;
+                        if ( !adefs[con]) {
+                          throw "Reference to undefined attribute '" + con + "'" ;
+                        }
                         sp.className = 'aref' ;
                         sp.setAttribute('title', con);
                         sp.innerHTML = '@'+con ;
@@ -216,6 +226,21 @@
 dl.triple dt, dl.triple dd { margin: 0; display: inline }
 dl.triple dt:after { content: ':'; }
 dl.triple dd:after { content: '\A'; white-space: pre; }
+.adef { 
+	font-family: monospace; 
+	font-weight: bold; 
+    color: #ff4500;
+}
+
+.aref { 
+	font-family: monospace; 
+	font-weight: bold; 
+    color: #ff4500;
+}
+
+span.entity { color: red; }
+
+span.element { color: green; }
 </style>
 </head>
 
@@ -286,6 +311,23 @@
       (See <cite><a href="http://www.w3.org/TR/2011/WD-microdata-20110525/#attr-itemscope">Section 3.2 Items</a></cite>
       of [[!MICRODATA]]).
     </dd>
+    <dt><adef>content</adef></dt><dd>
+      An attribute appropriate for use with the <code>meta</code> element for creating invisible properties.
+    </dd>
+    <dt><adef>data</adef></dt><dd>
+      An attribute appropriate for use with the <code>object</code> element for creating URI References.
+    </dd>
+    <dt><adef>datetime</adef></dt><dd>
+      An attribute appropriate for use with the <code>date</code> element for creating typed literals.
+      <div class="issue">The <code>date</code> element will likely be replaced with something more general purpose.</div>
+    </dd>
+    <dt><adef>href</adef></dt><dd>
+      An attribute appropriate for use with <code>a</code>, <code>area</code> or <code>link</code> elements for creating URI References.
+    </dd>
+    <dt><adef>src</adef></dt><dd>
+      An attribute appropriate for use with <code>audio</code>, <code>embed</code>, <code>iframe</code>, <code>img</code>,
+      <code>source</code>, <code>track</code>, or <code>video</code> elements for creating invisible properties.
+    </dd>
   </dl>
 </section>
 
@@ -409,58 +451,49 @@
             The value is <tref>URI reference</tref> that results from resolving the value of the element's
             <aref>data</aref> attribute relative to the element at the time the attribute is set.
           </dd>
-          <dt>If the element is a <code>time</code> element with a <aref>datetime</aref> attribute</dt>
+          <dt>If the element is a <code>time</code> element with a <aref>datetime</aref> attribute
+            <div class="issue">The <code>date</code> element will likely be replaced with something more general purpose.</div>
+          </dt>
           <dd>
             <dl>
               <dt>
                 If the value has the lexical form of <cite><a
-                href="http://www.w3.org/TR/xmlschema-2/#date">xsd:date</a></cite> [[!RDF-SCHEMA]]
+                href="http://www.w3.org/TR/xmlschema-2/#date">xsd:date</a></cite> [[!RDF-SCHEMA]].
               </dt>
               <dd>
                 The value is a <tref>typed literal</tref> composed of the value and
-                <code>http://www.w3.org/2001/XMLSchema#date</code>
+                <code>http://www.w3.org/2001/XMLSchema#date</code>.
               </dd>
               <dt>
                 If the value has the lexical form of <cite><a
-                href="http://www.w3.org/TR/xmlschema-2/#time">xsd:time</a></cite> [[!RDF-SCHEMA]]
+                href="http://www.w3.org/TR/xmlschema-2/#time">xsd:time</a></cite> [[!RDF-SCHEMA]].
               </dt>
               <dd>
                 The value is a <tref>typed literal</tref> composed of the value and
-                <code>http://www.w3.org/2001/XMLSchema#time</code>
+                <code>http://www.w3.org/2001/XMLSchema#time</code>.
               </dd>
               <dt>
                 If the value has the lexical form of <cite><a
-                href="http://www.w3.org/TR/xmlschema-2/#dateTime">xsd:dateTime</a></cite> [[!RDF-SCHEMA]]
+                href="http://www.w3.org/TR/xmlschema-2/#dateTime">xsd:dateTime</a></cite> [[!RDF-SCHEMA]].
               </dt>
               <dd>
                 The value is a <tref>typed literal</tref> composed of the value and
-               <code>http://www.w3.org/2001/XMLSchema#dateTime</code>
+               <code>http://www.w3.org/2001/XMLSchema#dateTime</code>.
               </dd>
               <!-- revisit when/if content model for @datetime is updated to allow for xsd:duration
               <dt>
                 If the value has the lexical form of <cite><a
-                href="http://www.w3.org/TR/xmlschema-2/#duration">xsd:duration</a></cite> [[!RDF-SCHEMA]]
+                href="http://www.w3.org/TR/xmlschema-2/#duration">xsd:duration</a></cite> [[!RDF-SCHEMA]].
               </dt>
               <dd>
                 The value is a <tref>typed literal</tref> composed of the value and
-                <code>http://www.w3.org/2001/XMLSchema#duration</code>
+                <code>http://www.w3.org/2001/XMLSchema#duration</code>.
               </dd>
               -->
               <dt>Otherwise</dt>
               <dd>The value is a <tref>plain literal</tref> created from the value.</dd>
             </dl>
           </dd>
-          <dt>
-            If the element is an <code>blockquote</code> or <code>q</code> element with a
-            <aref>cite</aref> attribute
-          </dt>
-          <dd>
-            The value is <tref>URI reference</tref> that results from resolving the value of the element's
-            <aref>cite</aref> attribute relative to the element at the time the attribute is set
-            <div class="note">
-              Was formerly document-level, now part of item value processing.
-            </div>
-          </dd>
           <dt>Otherwise</dt>
           <dd>
             The value is a <tref>plain literal</tref>, with the language information set from the language of the