[Microformats-dev] hcardTest materials, XHTML version of RFC2426, and fun with microformats

Dan Connolly connolly at w3.org
Mon Jul 25 14:23:18 PDT 2005


A week or so ago, I started working with the X2V code,
which works great but has a lot of redundancy. In order
to have some confidence that I wouldn't break it, I
developed a test case for each piece of the code that
I touched.

Each time I tweaked the code, I'd run it and
diff the output against my expected results, like this:

devcvs/2001/palmagent$ make hcard-test
xsltproc --novalid \
--stringparam Source
http://dev.w3.org/cvsweb/2001/palmagent/hcardTest.html \
--stringparam Anchor thisOne \
xhtml2vcard.xsl hcardTest.html >,hcardTest-actual2.vcf
diff -u hcardTest-expected2.vcf ,hcardTest-actual2.vcf
xsltproc --novalid \
--stringparam Source
http://dev.w3.org/cvsweb/2001/palmagent/hcardTest.html \
xhtml2vcard.xsl hcardTest.html >,hcardTest-actual.vcf
diff -u hcardTest-expected.vcf ,hcardTest-actual.vcf

The code is in
  http://dev.w3.org/cvsweb/2001/palmagent/

I haven't really packaged it or anything.

While I was at it, I enhanced my code for building
an XHTML version of the iCalendar spec to handle
the vCard spec. The result is...
  vCard MIME Directory Profile
  http://www.w3.org/2002/12/cal/rfc2426

with anchors like
 http://www.w3.org/2002/12/cal/rfc2426#Type_NICKNAME

I also converted this one...
  A MIME Content-Type for Directory Information
  http://www.w3.org/2002/12/cal/rfc2425

I chatted with some folks in #microformats about my
test materials, and we figured out that we can put them
in the wiki...
  http://microformats.org/wiki/hcard-tests

That has just a handful of the test cases, and it
doesn't have the expected results, and I haven't adapted
my test harness (i.e. Makefile) to use the test data
in the form, but I think it's reasonably straightforward
to do, and I'd like to see somebody give it a try.

I ran into some issues like case sensitivity along
the way. Those are in the wiki too
 http://microformats.org/wiki/hcard-issues

Tantek addressed several of those issues and I
updated my code and test materials to match.


p.s. Microformats are fun... I've been using XHTML dialects
to encode data like this at least as far back as March 2000...

 XSLT for screen-scraping RDF out of real-world data
 http://lists.w3.org/Archives/Public/www-rdf-interest/2000Mar/0103

and later...

 relational data views of XHTML via XSLT
http://lists.w3.org/Archives/Public/public-rdf-in-xhtml-tf/2003May/0002.html

which evolved into...

 Gleaning Resource Descriptions from Dialects of Languages (GRDDL)
May 2005
http://www.w3.org/TeamSubmission/grddl/

I hope that GRDDL and microformats get along better and better
over time. I've worked out most of the details of using
GRDDL with XMDP... but I see that the exact address
of the iCalendar XMDP profile is still an open issue
(http://microformats.org/wiki/hcalendar-issues ).


The connection to RDF gets particularly interesting when
you consider stuff like...

 "ATTENDEE in iCalendar may in hCalendar[sic] be represented
  by an hcard."
 -- http://microformats.org/wiki/hcalendar

I have had my own XHTML dialect that's sorta like hCalendar
since sometime in 2001; we use it for a semantic web
coordination calendar...

 "see also: formalized plan; in particular: plan-formal.rdf
plan-formal.n3 plan-formal.ics. See Makefile for details."
   -- http://www.w3.org/2001/sw/CG/#future


That approach uses a more local dialect of XHTML; the document
documents its dialects using a GRDDL profile and a transformation
link.

I might migrate it over to hCalendar, but that would add a lot
of tedium to the maintenance of the markup and I'm not sure
what the benefit would be... I'm still thinking it over.

I recently adapted my index of events and the people I met
at those events to use hCard...

http://www.w3.org/People/Connolly/events/

$ xsltproc --stringparam Source
http://www.w3.org/People/Connolly/events/ xhtml2vcard.xsl
http://www.w3.org/People/Connolly/events/

...
BEGIN:VCARD
PRODID:-//connolly.w3.org//palmagent 0.6 (BETA)//EN
SOURCE: http://www.w3.org/People/Connolly/events/
NAME: Dan Connolly's Index of Events
VERSION:3.0
FN:Tantek <C3><87>elik
N:<C3><87>elik;Tantek;;;;
URL:http://tantek.com/log/
END:VCARD
...




p.p.s. I tried to subscribe via the form at
  http://microformats.org/mailman/listinfo/microformats-dev
but I don't see the callback message, and I'm not sure
what my status is.

-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/
D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E



More information about the Microformats-dev mailing list