Monday, September 16, 2024

Understanding Microformats

You may have heard mention of “microformats” recently. If you investigated, you probably ran across mumbling like this from http://microformats.org/about/:

Designed for humans first and machines second, microformats are a set of simple, open data formats built upon existing and widely adopted standards. Instead of throwing away what works today, microformats intend to solve simpler problems first by adapting to current behaviors and usage patterns (e.g. XHTML, blogging).

That paragraph (and the rest of the page it came from) really does sum up microformats nicely. That it does so while leaving you still uninformed and clueless could be seen as mildly amusing for the cognoscenti, but probably is simply annoying and frustrating for everyone else.

Let’s take the mystery out of it: Microformats are nothing more (and nothing less) than using XHTML markup to more fully identify data. That’s it. No magic, no mumbo jumbo. Here’s an example:

Tony Lawrence A.P. Lawrence my-first-name@this-domain.com 1101 Lantern Lane Middleboro , MA , 02346 USA 781 249-8010
This hCard created with the hCard creator.

If you “View Source” on this page, you’ll see that each section of that “hCard” is marked with a “class” tag:

<span class="postal-code"02346</span

Note what’s important here is the “class=”, not the “span” – the class could have just as well be applied to a <li> tag. But if that’s all there was to microformats, they’d just be another confusing tagging mechanism, no doubt complete with a monstrous XML schema that tried to be all things to all people. That’s the inherent problem of data tagging after all: who defines the tags?

Microformats sidestep that issue. If you noticed the very first tag, it references something that already exists and is in wide use:

<div class="vcard">

That “div” encloses the other data and defines the meaning of the inner class tags. Any program that already understands vCards can now extract data directly from this web page and import that data into itself. There are Firefox extensions that do just that.

Now go back and look again at that paragraph I quoted. Makes more sense now, doesn’t it? Apple has given this a nod in theor new .Mac webmail, and Firefox seems to be planning more microformat integration, as does Microsoft, so you’ll probably be hearing this term again.

See The Big Picture on Microformats also.

*Originally published at APLawrence.com

Add to Del.icio.us | Digg | Reddit | Furl

Bookmark murdok:

A.P. Lawrence provides SCO Unix and Linux consulting services http://www.pcunix.com

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles

E a haven for delicious and safe food.