[uf-new] hAudio/table incompatibility (was: hAudio v0.7 released)

Manu Sporny msporny at digitalbazaar.com
Thu Oct 4 18:09:09 PDT 2007


Julian Stahnke wrote:
> I’d like to point out that the currently proposed spec
> (http://microformats.org/wiki/audio-info-proposal#Complete_Album_Examplet)
> of nesting an haudio element in a track element to mark up albums is
> incompatible with using tables for the track listings. In a table, you
> only have one element per track that wraps all the information (the
> table row). So both track and haudio would need to be the same element.

Julian, you are absolutely, 100% correct! Crap! :)

We hadn't considered the limitations of HTML tables, thanks for catching
that rather glaring problem with the new hAudio proposal.

I have a feeling that the following proposed solution is going to ruffle
a few feathers, but it seems to be the simplest way to address the
problem - make the hAudio parser do the heavy lifting.

PROPOSAL:

TRACK and HAUDIO can co-exist in the same CLASS attribute, but they must
be specified in that order. It is the hAudio parsers job to detect the
co-existence of these two properties and act accordingly.

EXAMPLE:

   <table>
    <tr><th>#</th><th>Track</th><th>Length</th></tr>
    <tr class="track haudio">
        <td>1.</td>
        <td class="recording">Sanity</td>
        <td><abbr class="duration" title="P348S">5:48</abbr></td>
    </tr>
    <tr class="track haudio">
        <td>2.</td>
        <td class="recording">Highway To Hell</td>
        <td><abbr class="duration" title="P219S">3:39</abbr></td>
    </tr>
   </table>

The only reason I mention that order is important in the attribute list
is because we might have 'track hvideo' in the future for DVD chapters,
television episodes or other track-like items.

I remember there being opposition to placing properties (TRACK) and
types (HAUDIO) together in the same CLASS attribute, but can't remember
what the logic was behind the argument.

If there is no opposition to this approach, we could adopt it and make
the parser do the hard work. Thoughts?

Below is a more complete, validated XHTML 1.0 document demonstrating the
fix. You can copy and paste it into the following URL to verify that it
is a valid XHTML 1.0 document:

http://validator.w3.org/#validate_by_input

-- manu

----------------------------------------------------------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
   <title>hAudio Table Example</title>
</head>
<body>
<p>This is an example of an hAudio in a table:</p>

<div class="haudio">
   <img class="photo" alt="Live Phish Album Image"
src="images/live_phish_vol_15.jpg" />
   <p>
   <span class="album">Live Phish, Volume 15</span>
   <span class="contributor">
      <span class="vcard">
         <span class="fn org">Phish</span>
      </span>
   </span>
   </p>
   <p>
   Released on:
   <abbr class="published" title="20023110">October 31, 2002</abbr>
   </p>
   <p>
   Acquire:
   <a rel="sample" href="/samples/live_phish_vol_15_sample.mp3">Sample</a>,
   <a rel="enclosure" href="/live/phish_live_phish_vol_15.mp3">Live
Recording</a>,
   <a rel="payment" href="/buy/phish_live_phish_vol_15">Buy High Quality
Track</a>
   </p>
   <p>
   Category: <span class="category">live</span>
   </p>
   <p>
   Duration: <abbr class="duration" title="P8727S">145 minutes, 27
seconds</abbr>
   </p>
   <p>
   Price: <span class="money">
             <abbr class="currency" title="USD">$</abbr>
             <span class="amount">14.99</span>
          </span>
   </p>
   <p>
   Tracks:
   </p>
   <table>
    <tr><th>#</th><th>Track</th><th>Length</th></tr>
    <tr class="track haudio">
        <td>1.</td>
        <td class="recording">Sanity</td>
        <td><abbr class="duration" title="P348S">5:48</abbr></td>
    </tr>
    <tr class="track haudio">
        <td>2.</td>
        <td class="recording">Highway To Hell</td>
        <td><abbr class="duration" title="P219S">3:39</abbr></td>
    </tr>
   </table>
</div>

</body>
</html>



More information about the microformats-new mailing list