Getting started with Saxon on the Java platform
Download the software (you will typically start with the open-source version) from
It will run on any machine that supports Java.
The software comes as a zip file. Unzip it into a suitable directory, for example
As a first-time user, you will probably want to install the sample applications.
These are packaged together with a copy of this documentation and Saxon-B source code
in the file
saxon-resources8-n.zip. This can be downloaded from either the
SourceForge or Saxonica sites. (It is the same file in both cases). Unzip the contents
of this file into the same directory.
Make sure that a suitable Java JDK is installed on your machine. Saxon
requires Java JDK 1.4 or later. If you have a choice, it is best to use JDK 1.5
(also known as J2SE 5.0),
since that includes the latest version of JAXP as standard, giving less scope for configuration
problems. If necessary, download
and install J2SE 5.0 from
Make sure that all the necessary files are on your classpath - this is the list of resources
available to the Java VM. For details, see Installing (Java).
If you are using Saxon-SA, the commercial schema-aware version of Saxon, you will need
to obtain a file containing a licence key. You can apply for a free 30-day license key by going to
www.saxonica.com and clicking on "Evaluation Copy". The license
key file will be sent by email within 24 hours. This file, called
must be placed in a directory that is listed on the Java classpath. Note that it is the directory
that must be on the classpath, not the
saxon-license.lic file itself.
Saxon doesn't come with a graphical user interface: it's designed to be integrated into
other tools and applications. You will therefore start by using it from the operating system
command line. On Windows, you may want to install a text editor such as
that offers a more friendly command line than the standard DOS console provided by Microsoft.
However, if you're not comfortable running applications from the command line, you might like to try
the open-source Kernow product
from Andrew Welch.
You can now run one of the sample stylesheets or queries that comes with in the
Assuming you installed into
c:\saxon, make this your current directory, and type:
for XSLT (all on one line):
java -jar saxon8.jar -t samples\data\books.xml
for XQuery (all on one line):
java -cp saxon8.jar net.sf.saxon.Query -t -s
samples\data\books.xml samples\query\books-to-html.xq >c:\temp.html
c:\temp.html in your browser to check that it worked.
For more details on installing Saxon on the Java platform, see