Rel vs. Rev

Another note in my very-neglected series on Semantic XHTML basics started awhile back.

It seems that everytime I present microformats, I need to explain the difference bettween the rel and rev attributes. Its understandable that most people don’t grasp the difference, as I’m sure most webdevelopers haven’t needed to make use of these semantics.

We have a good document on the wiki about this, so consider this an introduction.

First of all, rel is an attribute which can be applied to <a> and <link> to define the relationship between the linked document and the current one. So, a very common example is a link to a feed. This blog has:

<link rel="alternate" type="application/rss+xml" href="http://www.microformats.org/feed/" />

This can be read as http://microformats.org/feed/ is an alternate for http://microformats.org/ (Incidentally, the feed could link to this blog with rev="alternate", which would have exactly the same meaning. More on rev in a minute.).

rel is used by XFN, rel-tag, rel-directory and rel-payment microformats.

Now, rev is just like rel, but the relationship is reversed (I think of rev as “reverse relationship”). It gets used in the vote-links microformat like this:

<a href="http://supr.c.ilio.us/blog/" rev="vote-for" title="supr snark">supr.c.ilio.us rocks!</a>

…which would be read as “this document is a vote-for http://supr.c.ilio.us/blog/”.

rel and rev are useful for describing the relationships between two resources on the web. Remember, it is only the relationship between the documents, not the documents themselves which are described. Describing the documents themselves is another topic altogether.

Again, see the wiki for more info.

Tags:

4 Responses to “Rel vs. Rev”

  1. tomsw :

    Can I use ‘rev’ only in votelinks?

    December 3rd, 2005 at 7:14 am

  2. Ryan :

    @tomsw-

    By no means. rev can be usefule for many things, vote-links are just one example.

    December 4th, 2005 at 9:35 pm

  3. Kiss in the dark » Rel et Rev :

    […] Ryan King a publié hier soir sur le blog Microformats un article intéressant sur la différence fondamentale entre les propriétés rel et rev dans le XHTML. […]

    December 15th, 2005 at 4:19 am

  4. Revolução :

    […] Microformats: rel vs rev […]

    February 17th, 2006 at 3:54 pm