#!/bin/bash
set -e
if [ ! $1 ]
then
	echo "Usage: $0 <xml-file>"
	echo
	echo "Convert a pilot-qof todo XML file into a calcurse todo list."
	echo "One argument needed - the XML file. Redirect the output to"
	echo "your calcurse file with > ~/.calcurse/todo or to append "
	echo "use >> ~/.calcurse/todo "
	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-todo.xsl $1

