[uf-discuss] hCalendar anchors...

brian suda brian.suda at gmail.com
Sun Jan 15 08:03:51 PST 2006


In your examples, i think you are confusing two things:
1) The general rule you proposed is not true, it depends on two things,
first the TYPE of tag, behavior varies when it is an ABBR, A, IMG,
OBJECT, etc. The second issues is that depending on the class value
different areas are looked too for the TEXT.

so when we have class="url" AND it is an 'A' element it looks to the
HREF, if it were an 'IMG' element with a class="url" it would look to
the 'SRC' attribute. (i'm not sure if all of this is documented on the
wiki or not?) The hCard parsing page[1] has many of the rules for hCard
which are the same as hCalendar.

2) the next big issue is that your "Recommended result:" is only showing
a snippit of the actual full output, which might be confusing you as
well. Example 1 will have several properties outputted. Example 6 will
only have SUMMARY, sure it is in an 'A' element, but its class="summary"
so X2V looks to the TEXT not the href for the value. In example 7 the
class="url" extracts the data from the HREF and summary uses the node-value.

I hope this makes abit more sense to everyone,
-brian

[1] - http://microformats.org/wiki/hcard-parsing

Mark Mansour wrote:

>Hi,
>
>This is quite a big post so brace yourself :)
>
>I've found some more anomilies in hcal relating to anchors that I want
>to clarify.  I'm hoping that people will post their thoughts as I
>don't have a 100% definitive answer on how this should be done.  To
>the problem...
>
>The general rule for extracting info from hCal seems to be
> <tag class="microformat-element-name">text</tag>
>
>where the hcal entry looks like
> class-value:text
>
>but for anchors it seems to be
> <a class="microformat-element-name" href="location">text</tag>
>
>where
> class-value:href
>
>
>But there are a few exceptions to this case.  Below I have compiled a
>list of anchor examples to help highlight the issues.
>
>1. from http://www.microformats.org/wiki/hcalendar#Example
> <a class="url" href="http://www.web2con.com/">
>   <span class="summary">Web 2.0 Conference</span>:
>   <abbr class="dtstart" title="2005-10-05">October 5</abbr>-
>   <abbr class="dtend" title="2005-10-08">7</abbr>,
>   at the <span class="location">Argent Hotel, San Francisco, CA</span>
> </a>
>
>Recommended result:
> URL:http://www.web2con.com/
>
>Format:
> class-value:href
>
>
>2. from http://www.microformats.org/wiki/hcalendar-examples#5._iCalendar_Object_Examples
> <div>Organized by: <a class="organizer"
>href="mailto:jsmith at host.com">jsmith at host.com</a></div>
>
>Recommended result:
> ORGANIZER:MAILTO:jsmith at host.com
>
>Format:
> class-value:href
>
>
>3. from http://www.microformats.org/wiki/hcalendar-examples#Example_3_2
> <span class="attendee"><a class="value"
>href="mailto:jsmith at host1.com">jsmith at host1.com</a> RSVPed? <span
>class="rsvp">TRUE</span></span>
>
>Recommended result:
> ATTENDEE;RSVP=TRUE:MAILTO:jsmith at host1.com
>
>Format:
> class;sub-element-class=subelement-text:href
>
>
>4. from http://www.microformats.org/wiki/hcalendar-examples#Example_3_2
> <a class="attach" type="application/postscript"
>href="ftp://xyzCorp.com/pub/conf/bkgrnd.ps">ftp://xyzCorp.com/pub/conf/bkgrnd.ps</a>
>
>Recommended result:
> ATTACH;FMTTYPE=application/postscript:ftp://xyzCorp.com/pub/conf/bkgrnd.ps
>
>Format:
> class;FMTTYPE=attribute-type:href
>
>
>5. from http://www.microformats.org/wiki/hcalendar-examples#Example_6._Free.2FBusy_time
> <a class="url"
>href="http://www.host.com/calendar/busytime/jsmith.ifb">http://www.host.com/calendar/busytime/jsmith.ifb</a>
>
>Recommended result:
> URL:http://www.host.com/calendar/busytime/jsmith.ifb
>
>Format:
> class-value:href
>
>
>6. from http://suda.co.uk/projects/holidays/
> <a class="summary"
>href="createvcal.php?summary=Drinking%20Straw%20Day&amp;description=Today%20in%201888%20the%20drinking%20straw%20was%20patented%2C%20use%20it%20wisely&amp;date=20060103&amp;freq=YEARLY&amp;interval=1&amp;bymonth=1"
>title="Drinking Straw Day">Drinking Straw Day</a>
>
>Recommended result (from x2v):
> SUMMARY:Drinking Straw Day
>
>Format:
> class-value:text
>
>
>7. from http://lists.w3.org/Archives/Public/www-rdf-calendar/2006Jan/0003.html
> <span class="summary"><a class="url"
>href="http://dps1.travelocity.com/dparcobrand.ctl?smls=Y&amp;Service=YHOE&amp;.intl=us&amp;aln_name=AA&amp;flt_num=1655&amp;dep_arp_name=&amp;arr_arp_name=&amp;dep_dt_dy_1=23&amp;dep_dt_mn_1=Jan&amp;dep_dt_yr_1=2006&amp;dep_tm_1=9%3A00am">ORD-SFO/AA
>1655</a></span>
>
>Recommended result (from x2v):
> SUMMARY:ORD-SFO/AA 1655
> URL:http://dps1.travelocity.com/dparcobrand.ctl?smls=Y&Service=YHOE&.intl=us&aln_name=AA&flt_num=1655&dep_arp_name=&arr_arp_name=&dep_dt_dy_1=23&dep_dt_mn_1=Jan&dep_dt_yr_1=2006&dep_tm_1=9%3A00am
>
>Format:
> class-value:sub-element-text
> sub-element-class:sub-element-href
>
>1, 2, 3, 4, and 5 seem to follow the same format (3 and 4 show the use
>of parameters), they are also all from the microformats wiki.  6 is
>from suda.co.uk which has the primary hcalendar parser available
>(there is glean, but I haven't tried that yet).  7 is handled by x2v
>just fine, but is in a format that is different from the other
>examples.
>
>1 and 7 are opposites of each other, 1 is an <a class="url"
>href="location"><span class="summary">value</span></a> and 7 is <span
>class="summary><a class="url" href="location">value</a></span>.  I
>don't think both can be valid and to me 1 seems like the best choice
>as it is the most consistant and it is taking the href to be the url
>value - to me that seems like a good idea.  I don't like 7 because it
>seems to indicate that the URL is for the summary.
>
>6 is ok but not great as again, it seems to indicate that the summary
>has a URL rather than the entire event, maybe that is just me being
>fussy.
>
>So, what do people think of examples 1, 6 and 7?
>
>Mark
>_______________________________________________
>microformats-discuss mailing list
>microformats-discuss at microformats.org
>http://microformats.org/mailman/listinfo/microformats-discuss
>
>  
>



More information about the microformats-discuss mailing list