#!/bin/bash
set -e
if [ ! $1 ]
then
	echo "Usage: $0 <xml-file>"
	echo
	echo "Convert a pilot-qof datebook XML file into calcurse appointments."
	echo "One argument needed - the XML file. Redirect the output to"
	echo "your calcurse file with > ~/.calcurse/apts or to append "
	echo "use >> ~/.calcurse/apts "
	exit
fi
if [ ! -f $1 ]
then
	echo "First argument should be  an XML file."
	exit
fi
XML_CATALOG_FILES="/usr/share/xml/pilot-qof/xsl/catalog.xml" \
 xsltproc --nonet http://www.data-freedom.org/xsl/pilot-qof-calcurse-apts.xsl $1

