Because Ubuntu didn't see my manual installation of the
Oracle Java
JDK as a valid Java alternative I couldn't install Saxon-B
using apt-get install
. Instead of trying to
find a solution to this issue I decided to install Saxon
manually as well. And since I was now free in my choice, I
decided to install the more recent Saxon Home Edition
version 9.3.
Below follows a HOWTO of how I installed Saxon-HE version 9.3 successfully on Ubuntu 10.04 LTS.
Click the "Download for Java" link under the Saxon-HE 9.3 section on The SAXON XSLT and XQuery Processor page hosted at SourceForge.
After the download had finished I generated the MD5 digest. While no such digest is given on the Saxon page itself I publish the result here for reference.
cd ~/Downloads
md5sum saxonhe9-3-0-5j.zip
a940c252e1ae386a5f9949ace75e4ea6 saxonhe9-3-0-5j.zip
After the download has finished extract the zip file into
/usr/share/java
and clean up as follows:
sudo mv ~/Downloads/saxonhe9-3-0-5j.zip /usr/share/java
cd /usr/share/java
sudo unzip saxonhe9-3-0-5j.zip
sudo rm saxonhe9-3-0-5j.zip
Next, create two shell scripts, one to use Saxon HE as a
XSLT processor and one to use Saxon HE as an XQuery
processor. Name the first script saxon9he-xslt
and save it into /usr/bin
, for example using
sudo vi /usr/bin/saxon9he-xslt
, and copy the
following lines into it:
#!/bin/sh
exec java -cp /usr/share/java/saxon9he.jar net.sf.saxon.Transform "$@"
Name the second script saxon9he-xquery
and save
it into /usr/bin
as well. Copy the following lines
into this file:
#!/bin/sh
exec java -cp /usr/share/java/saxon9he.jar net.sf.saxon.Query "$@"
When done, make both files executable as follows:
sudo chmod 755 /usr/bin/saxon9he-xslt
sudo chmod 755 /usr/bin/saxon9he-xquery
Now if you enter saxon9he-xslt
on the command line
you should get the following warning.
No source file name
Followed by a message that gives the possible options and parameters.
Verify that saxon9he-xquery
gives a similar
output but that while saxon9he-xslt
refers to
net.sf.saxon.Transform
saxon9he-xquery
should refer to
net.sf.saxon.Query
.