[uf-dev] hCard locations in hCalendar

Ryan King ryan at technorati.com
Wed Apr 4 17:18:04 PDT 2007


On Apr 4, 2007, at 4:47 PM, Dan Connolly wrote:
> On Wed, 2007-04-04 at 16:24 -0700, Ryan King wrote:
>> On Apr 3, 2007, at 11:51 AM, Ryan King wrote:
>>
>>> 2. How can we specify this in our test suite?
>>>
>>> ....
>>>  * putting the vCards in separate vcf files. (not sure if ALTREP
>>> can take a relative URI, though. it should right?)
>>
>> Ok, I've tried this, hg patch at the end. Reasonable?
>
> Hmm... clever, at least. I had to look up ALTREP,
> but yup, it makes sense.
> http://www.w3.org/2002/12/cal/rfc2445#sec4.2.1
>
> Have you thought about how the test harness will work?
> Currently you could fill 20-location-hcard.vcf with
> gibberish and the tests would still pass, yes?

Yeah. I've been thinking about it. I've made it work for my (not open  
source yet) parser here at Technorati. Basically, when comparing the  
parsed hCalendar event to its counterpart, if LOCATION has an ALTREP  
parameter, open the URI (which is relative to the ics file in this  
case), parse the vCard and compare it to the location hCard I've parsed.

For something like X2V, where the iCal file is being produced by the  
tool (rather than a data structure, like I have), I'm not sure what  
to do. X2V should provide some URI there. Options for that URI:

1. Link to a vCard through X2V's hCard->vCard proxy.
  * Pros:
   * seems simple and useful
  * Cons:
   * makes the test suite a bit complex, since the ALTREP would need  
to be parameterizable. Of course, if we moved away from text  
difference testing we could more easily work around this.
   * Not all hCards can be linkable. If there's more than one on a  
page and they don't have @id's, there's no way to create a URI for  
the specific location hCard.
   * not sure that there are any iCalendar consumers that make use of  
ALTREP, so vCard probably doesn't matter

2. Link to the hCard.
  * Pros:
   * biased towards hypertext/HTML
  * Cons:
   * May not be linkable (see above).

3. Multipart MIME CID URIs
  * Pros:
   * Always linkable
  * Cons:
   * *ick*


I honestly don't know how to choose between #1 and #2. I'm also not  
sure how to represent it in the test suite.

-ryan
--
Ryan King
ryan at technorati.com





More information about the microformats-dev mailing list