[uf-discuss] class="url"?

Scott Reynen scott at randomchaos.com
Sat Nov 4 12:08:54 PST 2006


On Nov 4, 2006, at 1:38 PM, Siegfried Gipp wrote:

> for what purpose is the class="url" as attribute of a link?

> The href attribute of the <a> container on the other hand does  
> contain a url.
> It has to contain a url according to the html and xhtml  
> specifications.

Right, so the class="url" is communicating something else: that this  
URL is /the/ URL for the surrounding vevent.  A vevent can contain  
several URLs that have little to do with the event itself, e.g.:

<span class="location"><a href="http://www.argenthotel.com/">Argent  
Hotel, San Francisco, CA</a></span>

So we need class="url" to know which URLs belong to the vevent, and  
which don't.

There would probably be a better way to communicate that than  
class="url", since at first glance, it's redundant.  But because  
hcalendar is a 1-to-1 property mapping of vcalendar (to ease  
adoption), the property name URL in vcalendar became class="url" in  
hcalendar.

> The only correct usage of class="url" would be if that
> html container indeed contains a url.

Unlike most other properties, the URL property takes it's value from  
the href attribute, not contents of the container.  This isn't  
explained very clearly in the hcalendar description, but it is  
explained pretty clearly in hcard:

"For the "PHOTO" property and any other property that takes a URL as  
its value, the href="..." attribute provides the property value."

http://microformats.org/wiki/hcard#Human_vs._Machine_readable

Peace,
Scott



More information about the microformats-discuss mailing list