Using an xhtml profile, RSS+events and XSLT to manage events information

RSS, xhtml and XSLT

Some time ago, Dan Connolly wrote an XSLT stylesheet that allowed you to transform certain xhtml files to RSS 1.0. This was acheived using a profile of XHTML, in this case by adding attributes to various xhtml tags, as described here [danc]. It was based on Eric van der VList and Dan Brickley's XHTML-to-RSS Extractor service [extractor].

To see what it looks like do a 'view source on the homepage, and in the news part you'll see something like this (this is simplified):

<div class="item">
<h2>Speech Recognition Grammar Specification Advances to

W3C is pleased to announce the advancement of Speech
Recognition Grammar to Candidate Recommendation.
<a rel="details" href="">News


This information is transformed into RSS 1.0 using the stylesheet: dev with an item attribute becomes an RSS item; the content of the h2 tag becomes the title of the item; the a href tag with a details attribute becomes the link, and the conetnt of the p tag becomes the description.

The beauty of this technique is that you only have to describe the information once, but you can use it

Another nice thing is that anyone who can write xhtml by hand can also write this profile of xhtml, although of course the process will fall down if

Tidy can be used to solve the first problem. The second is trickier, and I don't really know what to do.

Calendaring and RSS

I've been working with calendaring in RDF for some time. It struck me that information about when events occured could be even more useful than a simple RSS feed. For example, if a machine could read when a conference started and finished, then it could display that information in a calendar-like format which could help people schedule their time (here's an example where I've done just that).

RSS 1.0 can be extended using 'modules', and one of these is an events module. Modules add a bit extra structured format to the standard RSS idea of titles, links and descriptions. RSS events module adds the following fields:


For showing calendar format as a calendar for humans, the most important of these are startdate and enddate. If we have these in the format specified (e.g. 2002-07-04) then we can use that information to show events by date, by month etc.

So I started to add to Dan Connolly's stylesheet to incorporate this information. This was made extremely simple by the fact that it was already a kick-ass stylesheet which could transform text descriptions of dates such as '5 June 2002' to the W3C's iso 8601 profile (2002-06-05) that was specified in the RSS events module.

This was great because it meant that I could have a highly readable date format within the text of the RSS description, which meant that tools which could not understand the events module (i.e. most RSS tools) would still give human readbale information about the start and end state of the event, and also the organiser, location and type. And also that this information did not have to be repeated in the xhtml view of the information.

So, the resultant stylesheet requires something like this sample:

<div class="item"> 
<h2><a id="rdfcore1" name="rdfcore1">RDFCore

SWAD-Europe members will be attending the 
<a rel="details"
meeting in <span class="location">Bristol, UK</span>, 
<span class="startdate">17 June 2002</span> and <span
class="enddate">18 June 2002</span>.


...and that's it. It just builds on Dan Connolly's stylesheet and adds span elements with attributes for startdate, enddate and location. Event typing information and organiser could be added very simply.

Other information

As with Connolly's sheet, you have to include a line about the profile url in the head:

<head profile="">

@@Issue: that should be the new profile not the old one.

You also need to include information which will tell the stylesheet the title and link for the channel: this is the same as Connolly's one, i.e.:

To transform the sheet, you an use the W3C's XSLT service, e.g.:

This wil allow you to see the rss as html; you can feed this into fancier things, for example this demo using an RDF query language.



RSS 1.0

RSS 1.0 module events

Dan Connolly's Site summaries in HTML page:

and XSLT stylesheet:

the same stylesheet altered for rss events:

A sample page which can be transformed to an events RSS feed:

An example of what you can do with it:

Calendar taskforce webpage, mailing list, recent update

RDF interest group homepage