innerjoin

innerjoin | iCalendar
Innerjoin Home Up Help

Mozilla Calendar Notes and Queries

Using Mozilla? Downloaded the calendar extension? Want to export events in XML format? or create calendars which can be published on the web and imported?

These notes are written round Calendar 0.8 with Mozilla 1.1, the stable release as of September 2002, on a Linux client

Note that Mozilla Calendar's capability to import/export XML format iCal files was not carried over to Sunbird.

Notes and Queries

Publish, Subscribe, Import and Export

Mozilla Calendar maintains clear distinctions between publishing, subscribing, exporting and importing data.

Mozilla Calendar and Sunbird have a option for exporting the calendar data, the Firefox Calendar extension does not seem to have one.

The difference for the user is that, if they subscribe to a published calendar, if the source data changes then they see the results of the change, if they have imported an event however there is no reference back to the original source.

To XML and back

Mozilla Calendar's native format is iCalendar (see 'the source', RFC 2445, or a cross-referenced subset of the file format) These are conventionally held as .ics files. Information about events can however be exported (in the Mozilla Calendar) in several formats, iCal to .ics files, xCal to .xcs, RDF and CSV.

A test event in the iCalendar format might look like:

See the index of test cases for .ics and .xcs examples and the test data, moz-0-8/ical.ics as text/calendar to allow you to subscribe, or text/plain.

which can be exported in xCal format, giving a transliteration of the original data:

moz-0-8/xcal.xcs as text/xml, download the file in Mozilla and use View Source to see the structure or see the text/plain version.

Internet Explorer and Mozilla 1.2 will display the XML using a default style which allows you to explore the data.

The xcal format is not related to xcal (a calendar application for X)

This is a slightly tidied rendering of the export, Calendar does not bother splitting up the data into separate lines. If .xcs files are given a text/xml MIME type by the webserver, Mozilla will treat them as 'well formed' XML documents (see moz-0-8/xcal.xcs).

The idea is that there is nothing new in the xCalendar format, the data is just wrapped up in a different fashion to let XML tools handle it.

There are two main criteria for exporting and importing data:

Mozilla Calendar is not able to subscribe to xCal (calsch archive) data. Mozilla Calendar 0.8 crashes when subscribing, you have to import the data into your personal calendar

Round trips and URL's

URL parameter

If you export an event in xCal format which includes a URL attribute from Mozilla, the URL is exported as a string:

If you then import it, that URL information is not picked up (Calendar 0.8). This may be a bug or that Calendar is not using the proper mechanism.

URL as ENTITY

The xCal draft spec (calsch archive) does not show URL's as strings, where they give examples they follow a far more formal route and define the URL as an ENTITY:

and refer to that within the event

moz-0-8/xcal-url-entity.xcs as text/xml and use view source to see the parsed data, or text/plain

The issues are:

Using XML Transforms

It is possible to transform the exported .xcs file, as it is XML, so it can be displayed in a browser. This can be done on the client or server.

Client-side Transforms

The transformation can, theoretically at least, be done at the client. This means that the browser downloads the XML, downloads the code to transform it (some XSL code) and does the conversion itself. Typically the XML data is converted to XHTML so that a browser can render it. Of course this means that you are prepared to target your pages at the subset of browsers which understand XML and can apply XSL transforms.

You tell the browser about the XSL by adding a separate line, a xml-stylesheet directive, to the .xcs file which says which .xsl file to use:

This is xml-stylesheet not xml:stylesheet. The latter was from an earlier draft but some of the tutorials on the web still refer to it.

Server-side Transforms

If you want to serve your calendar as HTML from the server and not depend on the browser to do the conversion you need an application on the server to do the transformation work.

With Apache / Tomcat / Cocoon this is straightforward, or it is straightforward once you have Tomcat and Cocoon running and configured. You still include extra lines in the .xcs file, this time for Cocoon to recognise:

The server then takes the XML, follows the instructions in the .xsl file and serves HTML.

Note that both these options depend on an editing step to add the xml-stylesheet directive to the .xcs file. The difficult step is, of course, writing the XSL transform.

Navigation: [ Home ] [ Index ] [ Site Map ] [ Translate ] [ Up ] [ What's New ]
Mail: mgk@iv.mmv.innerjoin.org, 2005/03/29
URI: http://www.innerjoin.org/iCalendar/import-export-xCal.html
Keywords:innerjoinorg200112, innerjoinorg, innerjoin, mozilla, calendar, mozcal, howto, xcal, ical, xcs, ics