Scripts. XSL conversions can require a lot of commands and options, most of which do not change between runs. pilot-qof includes sample scripts that demonstrate how to ease the process.
Example 4.1. Using stylesheets in scripts of your own
A typical command from one of these scripts is:
XML_CATALOG_FILES="/usr/share/xml/datafreedom/xsl/catalog.xml" \
xsltproc --nonet http://www.data-freedom.org/xsl/pilot-qof-calcurse-todo.xsl $1
$1 indicates the first argument passed to the script (in this
case an XML file). XML_CATALOG_FILES is an environment
variable, set just for this script. Where stylesheets in this manual can
use other options, these are documented in a shortened form that omits the
environment variable and the URL of the stylesheet.
Sample bash scripts are neither installed into system-wide locations nor available within the default system path. You are advised to copy the scripts into user-specific locations to make it easier to adjust the script behaviour.
pilot-qof-2-address-vcard1
A sample bash script that demonstrates how an XSL stylesheet can
be used with less typing. It uses
pilot-qof-address-vcard1.xsl as an example. Other
scripts are also included:
pilot-qof-2-apts-calcurse
Automate use of the pilot-qof-calcurse-apts.xsl stylesheet.
pilot-qof-2-todo-calcurse
Automate use of the pilot-qof-calcurse-todo.xsl stylesheet.
dfexport-all
dfexport-all is intended to export
pilot-qof data to various supported applications.
Unlike the datafreedom stylesheets which can work with just the QSF XML,
this example script uses the pilot-qof utility to update
and query the XML. The script will fail if pilot-qof
is not installed.
dfexport-all should be run in the same
directory as the pilot-qof data. If the
offline.xml is not in the correct directory,
dfexport-all will seek to connect to the Palm to create
the file from a pilot-qof HotSync.
For this reason, dfexport-all is still an example
script (installed in /usr/share/ not /usr/bin).
Supported applications:
Others
Any plain text, XML or HTML format can be generated, including possibly LDAP. If you have a request for an XSL stylesheet or if you have a stylesheet you would like to make available to others, mention it on the QOF-devel mailing list. http://lists.sourceforge.net/lists/listinfo/qof-devel
Although it is fine to pipe pilot-qof output to other processes like xsltproc, (note the terminal dash - to denote that xsltproc should expect the XML content on stdin) :
Example 4.2. Redirection from a QSF XML file.
$ pilot-qof -x whole_year.xml --invoice-city -t 2006-03-01 | \
xsltproc --nonet http://www.data-freedom.org/xsl/pilot-qof-invoice-xhtml.xsl -
Just remember that it might not be so wise to do this:
Example 4.3. Redirection from a HotSync - use with caution.
$ pilot-qof -a --invoice-city -t 2006-03-01 | \
xsltproc --nonet http://www.data-freedom.org/xsl/pilot-qof-invoice-xhtml.xsl -
Why? Because using -a means that your Palm data is
not being backed up in this process (because the XML sent to xsltproc by the
pipe is not saved and cannot be recreated from the HTML). Now, of course, you
can sync your Palm twice but reading from the backup file is a lot faster.
"If the Palm data has changed, use -a to backup to file.
If the Palm data has not changed, use -x to
read the backup file."
Reporting Bugs. Please do NOT report bugs in pilot-QOF to pilot-link or GnuCash. Report bugs via the QOF-devel mailing list. http://lists.sourceforge.net/lists/listinfo/qof-devel