I’ve been playing with the vCard format for a project at work and I gotta say, there’s a technology that’s begging to be re-implemented in XML. I mean, here’s the behind-the-scenes formatting of a vCard file:
BEGIN:VCARD FN:Mr. John Q. Public, Esq. N:Public;John;Quinlan;Mr.;Esq. BDAY:1995-04-15 ADR;DOM;HOME:P.O. Box 101;Suite 101;123 Main Street;Any Town;CA;91921-1234; TEL;PREF;WORK;MSG;FAX:+1-800-555-1234 END:VCARD
…with a bunch of arcane rules for delimiters and encoding. Uh, hello? EDI? 1989 called, and it wants its format back.
Wouldn’t something like this XML mockup of the same thing just make more sense?
<vCard> <name> <family>Public</family> <given>John</given> <additional>Quinlan</additional> <prefix>Mr.</prefix> <suffix>Esq.</suffix> <formatted>Mr. John Q. Public, Esq.</formatted> </name> <dob>1995-04-15</dob> <address> <type>Domestic, Home</type> <po>P.O. Box 101</po> <extended>Suite 101</extended> <street>123 Main Street</street> <locality>Any Town</locality> <region>CA</region> <postalCode>91921-1234</postalCode> </address> <telephone> <preferred /> <type>Work, Message, Fax</type> <number>+1-800-555-1234</number> </telephone> </vCard>
Well, it appears as though this standard was ratified in 1998, when XML was a newborn. I’m sure at the time that even if it were considered, the fact that XML files get to be about twice as large was a limiting factor, and lack of support in embedded devices for XML parsing was another. Everyone had PIC microchips back then and simple BASIC interpreters. Hunting for obscure delimiters to parse a file could be done in fewer lines than parsing XML or even SML.
And I’m sure that by now they have an indefinite number of legacy embedded devices to pander to. Hell even my vheapy nokia can trade business cards over IR, probably in this format π
Yeah yeah yeah, stop making so much sense! π
Hot. Totally hot. The geekiness goes up to 11.
Why have "PREF" as a singleton tag? I would have thought that making it an attribute of the telephone tag is more sensible. Heck, if you’re going to reformulate vCards as XML, you could extend them a bit by making the value of preferred="n" an index, so you can list numbers in order of preference (1, 2, 14, etc)
But hey, it’s just a thought experiment anyway, right? π
The W3C has a Note about implementing a vCard format in RDF
http://www.w3.org/TR/2001/NOTE-vcard-rdf-20010222/
FoaF also does much of the same, with XSLT you could map between the two.