Apache FOP with Saxon on Ubuntu

I wanted to use some XSLT2.0 features in a document that I was developing for a uzERP customer. Here is how I Replaced the default Xalan XSLT processor with Saxon in Apache FOP.

Apache FOP is a print formatter that uses XSL formatting objects (XSL-FO) to transform XML into a PDF for viewing or printing. We use FOP in uzERP to output documents like invoices, orders and reports. Recently, I wanted to use some XSLT2.0 features in a document that I was developing for a uzERP customer, but FOP uses Xalan as its default transformation engine and that only supports XSLT1.0.

FOP is a Java application and XML processing is pluggable using the Java API for XML Processing (JAXP), so Xalan can be replaced with an alternative processor. We are deploying our customer systems on Ubuntu 14.04 and packages are available for Saxon 6.5.5, an XSLT processor that supports new features first defined in the XSLT 1.1 working draft. This was enough for me to be able to use the format-date function and a few others in my stylesheet, but

How to persuade FOP to use Saxon?

First of all, install the Saxon packages:

Copy the FOP command line script:

Edit the copied script file:

I want this script to override the standard FOP script when using the fop command, so added a system wide alias by creating a file called fop-alias.sh in /etc/profile.d with the following contents:

With all that done, the fop command will now load the Saxon XSLT processor, which enables access to a number of useful extensions not available in XLST1.0

Use Network Manager to Turn off auto screen-lock in Gnome Shell

A follow-up to my previous post on running a script from PAM. Here is another way to control Gnome screensaver auto-lock, from NetworkManager in Linux.

A follow-up to my previous post on running a script from PAM. Here is another way to control Gnome screensaver auto-lock, from NetworkManager.

https://gist.github.com/steveblamey/b456cf7ceb4b84ba6402

PAM Script to Turn off auto screen-lock in Gnome Shell

In Linux, we have Pluggable Authentication Modules and various applications use PAM to authenticate users. Marco Ditri posted about using PAM to run a script that would prevent xscreensaver from locking the screen on his laptop when connected to his home wireless network.

Update: I’ve created a new version of this script that can be run by NetworkManager, turning Gnome screensaver auto-lock on or off as the wireless essid changes.

In Linux, we have Pluggable Authentication Modules and various applications use PAM to authenticate users. Marco Ditri posted about using PAM to run a script that would prevent xscreensaver from locking the screen on his laptop when connected to his home wireless network.

I wanted to do the same in Gnome, so I’ve modified Marco’s script to use gsettings to disable Gnome Shell auto screen-lock when authenticated to particular wireless networks and enable it everywhere else. You’ll find comments in the script on how to incorporate it in your local PAM configuration.

https://gist.github.com/steveblamey/11344909