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.
First of all,
rel is an attribute which can be applied to
<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
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.).
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.