Sign In/My Account | View Cart  
advertisement


Listen Print Discuss
What Are Microformats

What Are Microformats

by Micah Dubinko
March 23, 2005

"The cheapest, fastest and most reliable components of a computer system are those that aren't there." —Gordon Bell

The phrase "XML world" paints an apt word picture, for on top of a bedrock specification lives a thriving ecosystem, inhabited by complex layers of specifications, products, and personalities, both individually and in consortia. Like any ecosystem, XML world is subject to Darwinian natural selection and periodic adjustments. The best ideas tend to stick around.

The idea of microformats is particularly being explored of late. Previously, XML-Deviant discussed several microformats in the context of Google's good example of utilizing new technologies. But what exactly is a microformat? A primary source for microformat information is Technorati's developer wiki entry, which doesn't define the term, but rather illustrates around it. In summary, the wiki states that microformats are

  1. a way of thinking about data;
  2. design principles for formats;
  3. adapted to current behaviors and usage patterns;
  4. highly correlated with semantic xhtml;
  5. a set of simple data formats that many are actively developing and implementing.

To explain it by example, say you are putting a set of presentation slides online. What format do you use? A proprietary binary format? Some kind of 'SlideShowML' designed by committee? Or a directed subset of XHTML? The latter choice is best described as a microformat, and has been implemented as S5 (A Simple Standards-Based Slide Show System) — a bit more on that later.

Again summarizing the wiki, microformats are, just as importantly, defined by what they are not:

  1. not a new language;
  2. not infinitely extensible and open-ended;
  3. not an attempt to get everyone to change their behavior and rewrite their tools;
  4. not a whole new approach that throws away what already works today;
  5. not a panacea for all taxonomies, ontologies, and other such abstractions;
  6. not defining the whole world, or even just boiling the ocean.

Related Reading

Developing Feeds with RSS and Atom
By Ben Hammersley

Microformats take aim at a specific problem and solve it, a highly vertical approach. When written up, specifications for microformats are short and readable to the point that it's almost a pleasure to read them.

Does this mean that broadly applicable or horizontal formats are past their prime? Is this an exclusive new way of looking at the world? As much as I'd like to see fewer phonebook-sized specifications, that's not the case. Adam Rifkin's blog mentions "paving the cowpaths", a philosophy that builds on existing infrastructure. Horizontal formats (megaformats?) are a critical substrate underneath microformats. In particular, XHTML appears time and again in a symbiotic relationship with microformats.

Still, some gray areas remain. For example, is RSS a microformat? It seems to bear at least some of the characteristics of one, but on the other hand, a directed subset of XHTML could easily fulfill a similar role in a much more microformat-ish way.

So, we'll have to settle for a slightly vague definition of "microformat". That doesn't mean they're not useful, though, as we shall see.

In Practice

Some of the simplest microformats consist of new values for the existing rel attribute. Creative Commons helped inspire rel='license', accompanied by a href attribute pointing to an actual license. Also, more weblog authors are starting to use rel='tag' to provide folksonomy tagging to their entries. The nofollow was discussed earlier, and still more are in use, including XFN and VoteLinks. All in all, an impressive level of utility for what amounts to reusing an existing attribute.

A more substantial example is XOXO, or Extensible Open XHTML Outlines. Looking at some samples, the markup is stark. At first glance, a reader might feel like something is missing. At a second glance, a reader might appreciate the bare elegance of the format.

An XOXO fragment

<ol class='xoxo'>
  <li>Subject 1
    <ol>
        <li>subpoint a</li>
        <li>subpoint b</li>
    </ol>
  </li>
  <li>Subject 2
    <ol compact="compact">
        <li>subpoint c</li>
        <li>subpoint d</li>
    </ol>
  </li>
</ol>

Some people might feel warmer and fuzzier with elements named outline, topic, item, and so on, or with elements in a freshly minted namespace, but microformats can still claim the semantic high ground, even when reusing XHTML. In the above, the parts of an outline are ordered lists and list items, exactly as the XHTML element names say.

Other key microformats along these lines are hCard (vCard in XHTML) and hCalendar (RFC 2445 iCalendar in XHTML). Eric Meyer's S5 is another great example; if you look behind the scenes, you see nothing but clean, semantically pure markup.

So what are the advantages of reusing XHTML rather than creating from scratch?

  1. XHTML has been thoroughly debated, designed, and tested, and mostly avoids pitfalls that a fresh language might step in.
  2. Fragments of the microformat can be placed directly in XHTML web pages.
  3. Existing tools Just Work.
  4. Well-known element names, augmented with judicious class and id attributes, provide hooks for CSS styling. Default stylesheets do the rest.
  5. Additional functionality can be gracefully added within the existing semantics.

Reusing existing markup languages this way is another case of what I call "intentional markup" — that the author's job is to encode her intent through markup, and the client software's job is to render that intent in whatever way makes sense for the local user. Capture the intent using horizontally-standardized markup, and the rest will follow.

Roll Your Own Microformat

Previously, XML-Deviant discussed certification tests, which run on a software platform that looks like it hasn't been updated in five or ten years. The format of the questions is multiple choice, with an indication of whether one or a specific number of answers are correct. This is a well-worn cow path, so let's pave it. I dub the microformat sketched out below the Exam Markup Language, or Examl for short.

The forms language in XHTML 1.x turns out to be slightly clumsy for this sort of thing, so Examl is based on XHTML 2.0, which includes XForms.

An Examl fragment

<select ref="q1" class="examl">
  <label>What is the airspeed velocity of an unladen swallow? (pick 2)</label>
  <item>
    <label>I don't know</label>
    <value>1</value>
  </item>
  <item>
    <label>African or European?</label>
    <value>2</value>
  </item>
  <item>
    <label>9.8 m/s*s (for ex-swallows)</label>
    <value>3</value>
  </item>
  <item>
    <label>Three!</label>
    <value>4</value>
  </item>
</select>

Again, the markup clearly expresses intent; CSS, script, or XForms bindings, can be used to refine the user experience to any desired degree.

The above is only a quick sketch. If enough community interest exists, I will develop this language further; watch here for details and announcements. I encourage others to experiment with microformats and post your results.

Are microformats here to stay? The name may be new, but the general idea has been around for almost as long as markup languages have been. The XML ecosystem is expansive, in that lots of new ideas (or recycled old ideas) are continually being explored. If it can be done, someone, somewhere, is probably doing it. In this light, microformats are a refreshing new way of looking at tools we regularly use.

Births, Deaths, and Marriages

Also in XML-Deviant

The More Things Change

Agile XML

Composition

Apple Watch

Life After Ajax?

Tiger XSLT Mapper 2.0

Free developer edition now available as an Eclipse plug-in.

Saxon dot NET 1.0 RC1

Now available for download. A few minor changes still expected before final release.

Documents and Data

More on XRules: detailed discussion of using XForms to accomplish similar goals.

Elements vs. attributes, again. Len points to the definitive answer.

Perma-perma-thread.

My new favorite XSLT resource: minesweeper


Comment on this articleShare your experience in our forums.
(* You must be a
member of XML.com to use this feature.)
Comment on this Article


Titles Only Titles Only Newest First
  • #1 Locksmith Simi Valley call 1-877-364-5264
    2009-06-11 15:37:46 whats [Reply]

    #1 Locksmith Simi Valley call 1-877-364-5264
    Full service locksmith home, business and car
    #1 24 Hour Locksmith Los Angeles
    call 1-323-678-2704
    Locksmith services Los Angeles, including locks installation, doors locks repair, doors locks rekey, locks and keys products or services the best value and commitment to customers 100 satisfaction guaranteed.
    24 Hour Emergency Locksmiths Service
    Burglary Repairs Los Angeles County


    Professional Lock Repair




    Professional Door Lock Replacement




    Professional Lockout Services




    Professional Door Locks Rekeying




    Immediate Response 24 hours a day




    Doors Locks Installation




    Automotive Locksmith


  • Very good article
    2007-02-08 02:33:21 Aukcje [Reply]

    Enjoyed browsing through the site. Keep up the good work. Greetings from Meble (http://www.mebs.pl)

  • XHTML 2 as the 'Universal Document' ... and the 'Universal Form'
    2005-03-24 03:47:23 mark.birbeck@x-port.net [Reply]

    Hey Micah,


    Great article!


    I looked at some related issues in my blog a few months ago. The basic idea proposed was that XHTML 2 will increasingly become a common 'base class' for documents containing certain types of data, but that the 'extensions' would be provided by the changes to meta and link that the XHTML 2 specification gives us.


    There are a couple of reasons I like this approach. The first is that it means you can validate your documents without having to keep creating new schemas. The second is that it allows for different data types to be mixed without enforcing some sort of separation -- I like the fact that it is pretty easy in the same document to mix contact info with calendar entries, and even exam results!


    And third, making XHTML 2 both a data format *and* a UI format means that your pages become both the data *and* the metadata -- for example, your home page can be your RSS feed, without changing.


    But one of the goals of all of this, as mentioned in the blog, was to make building the UI that edits these documents much easier; in the old days the moment you started a new project you had to come up with a new data format. Nowadays, although you generally use XML instead, the equivalent is that you immediately have to come up with a new UI to edit the data.


    Most of the time the forms differ only in the names on the controls or the help and hint text. By making more and more use of XHTML 2 as a data format, we can start to create UIs as *patterns*. And then the form that edits the slide-show can also edit the list of RSS feeds, list of contacts, list of appointments, and so on.


    All the best,


    Mark


    Mark Birbeck
    CEO, x-port.net Ltd.
    http://www.formsPlayer.com/

    • Are these really benefits?
      2006-06-25 18:37:51 Logomachist [Reply]

      I like the idea of microformats, the idea that programs can be equipped to handle certain metadata in specific ways, and the ability to mix simple data types within documents, but I have to wonder if some of the points you mentioned are really that beneficial.


      <blockquote>
      The first is that it means you can validate your documents without having to keep creating new schemas.
      </blockquote>


      If the document schema is loose and doesn't fit the information you're denoting, doesn't that defeat the purpose of validation?



      <blockquote>
      And third, making XHTML 2 both a data format *and* a UI format means that your pages become both the data *and* the metadata -- for example, your home page can be your RSS feed, without changing.
      </blockquote>


      Isn't this the same as saying it mixes content and presentation, and therefore is a big no-no? Wasn't HTML designed from the start to delinate a documents structure, not presentation? That's what we have styling languages for, and they work as well for XML as they do for (x)HTML.


      <blockquote>
      Nowadays, although you generally use XML instead, the equivalent is that you immediately have to come up with a new UI to edit the data.
      </blockquote>


      I don't see much benefit here. CSS is (relatively) easy.