[Microformats-dev] hcardTest materials, XHTML version of RFC2426,
and fun with microformats
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
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 Anchor thisOne \
xhtml2vcard.xsl hcardTest.html >,hcardTest-actual2.vcf
diff -u hcardTest-expected2.vcf ,hcardTest-actual2.vcf
xsltproc --novalid \
xhtml2vcard.xsl hcardTest.html >,hcardTest-actual.vcf
diff -u hcardTest-expected.vcf ,hcardTest-actual.vcf
The code is in
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
with anchors like
I also converted this one...
A MIME Content-Type for Directory Information
I chatted with some folks in #microformats about my
test materials, and we figured out that we can put them
in the wiki...
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
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
relational data views of XHTML via XSLT
which evolved into...
Gleaning Resource Descriptions from Dialects of Languages (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
The connection to RDF gets particularly interesting when
you consider stuff like...
"ATTENDEE in iCalendar may in hCalendar[sic] be represented
by an hcard."
I have had my own XHTML dialect that's sorta like hCalendar
since sometime in 2001; we use it for a semantic web
"see also: formalized plan; in particular: plan-formal.rdf
plan-formal.n3 plan-formal.ics. See Makefile for details."
That approach uses a more local dialect of XHTML; the document
documents its dialects using a GRDDL profile and a transformation
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...
$ xsltproc --stringparam Source
PRODID:-//connolly.w3.org//palmagent 0.6 (BETA)//EN
NAME: Dan Connolly's Index of Events
p.p.s. I tried to subscribe via the form at
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