Dan rants: XML for Calendars

This is a preliminary note and subject to change. Please e-mail me before implementing anything with it. Thanks!

Further Note: I'm looking at ways to use RFC 2445 to do this.

For most sorts of data there's an economic reason to not publish XML. No company wants to compete on price, a century of graphic design theory (as implemented quite often in web pages) argues against making product information easily accessible.

But there's one place where people do have an incentive to give the data in its raw form: calendars and schedules. There's also a real need for this information, I don't remember to check all of the calendars for all of the groups that might have interesting events, but if it all happened in a single web page or application I probably would.

So to that end I present a proposal for XML encoding of calendars of events.

This is a first draft, and I'm looking for two things:

First is that I undoubtedly structured some of this data wrong or left out necessary information.

But second, and more important, is that I don't have a background in the XML community. I don't have a feel for the right naming conventions, when to put things in attributes (current attitudes seem to be "never"), stuff like that. It is this that I'm looking for most of my feedback on.

Anyway, if I can get some feedback we'll get some data scrapers implemented so we've got sources and throw together some applications which use this data.

Notes on criticism thus far

No recurring dates

In an an article on the scripting news discussion forum , Fim Flanagan asked about recurring events ("First Tuesday of the month", etc).

I see too many exceptions. I think that the right way to deal with this to have a set of reference scripts which generate recurring calendars. Even with fairly consistent get-togethers there are still changes with speaker information.

If you need to generate a bunch of such dates quickly, a simple Perl subroutine to do so:

use Date::Calc qw(Nth_Weekday_of_Month_Year);
sub RecurringDate($$$$)
    my ($startTime, $ordDay, $dow, $count) = @_;
    my ($month, $year) = (localtime($startTime))[4,5];
    $year += 1900;
    my ($i, @ret);
    for ($i = 0; $i < $count; $i++)
	my ($y,$m,$d) = 
	    Nth_Weekday_of_Month_Year($year + int(($month + $i) / 12),
				      ($month + $i) % 12 + 1,
	push @ret, sprintf("%4.4d-%2.2d-%2.2d",
    return @ret;

Description of the tags

Encloses everything
The URL for this file.
The URL to get an HTML version of this file. I expect that there'll be a couple of CGI scripts to do data scraping and harvesting, so this may actually point to the original data, whereas "xmlsource" might point to a script on another server altogether.
The sponsoring organization of this calendar. This is denoted by
ala "The Churchill Club" or "North Bay Multimedia Association".
a URL to the sponsoring organzation. http://www.churchillclub.com/ or http://www.nbma.com/ in the above instance.
Events can be nested, you might have a conference which runs a week, then within that conference have the individual sessions. A question I've yet to resolve is how do we do short events that might have a schmooze hour before the main speaker, as a simple nested event?
Time the event begins, either HTTP ("Dow, DD Mon YYYY HH:MM:SS TZ") or ISO 8601 ("YYYY-MM-DD HH:MM:SS TZ") format.
Time the event ends, either HTTP or ISO 8601 format.
A short "what the event is"
An abstract paragraph or so introduction.
Where the event is happening
A name and address
A url for further information, how to get there, etc.
This could be sort of tricky given the some of the cost schemes for various conferences and could be omitted, but it's just plain text ("$10-$90 sliding scale").
Text name
Vice president of chihuahua marketing
URL to personal notes or what-have-you.


Saturday, December 18th, 1999 danlyke@flutterby.com