-
Notifications
You must be signed in to change notification settings - Fork 44
Installation on Mac and Linux
XSpec requires the Saxon XSLT and XQuery processor which can be downloaded from:
- Saxon HE (open source)
- Saxon PE/EE (commercial products)
For this installation the Saxon JAR (e.g. saxon9he.jar
) is assumed to be in ~/xspec
.
-
Clone the master branch of XSpec from GitHub:
git clone https://github.com/expath/xspec.git
For this installation both XSpec and Saxon are assumed to be in
~/xspec
. -
Set up the Saxon environment variables. You can either set
$SAXON_HOME
to the location of the Saxon jar file:export SAXON_HOME=~/xspec/
or alternatively set
$SAXON_CP
to the full classpath containing the Saxon jar file:export SAXON_CP=/path/to/saxon/saxon9he.jar
You can check that the environment variable is set with:
echo $SAXON_HOME
SAXON_CP
has precedence overSAXON_HOME
.If you want to make the change permanent, set the environment variable in your shell profile (e.g.
~/.bashrc
or~/.bash_profile
). -
Open up a terminal, navigate to
~/xspec
, make sure that the filebin/xspec.sh
is executable, and test the shell script with this command:bin/xspec.sh -h
The output should be the following usage summary:
Saxon script not found, invoking JVM directly instead. Usage: xspec [-t|-q|-c|-h] filename [coverage] filename the XSpec document -t test an XSLT stylesheet (the default) -q test an XQuery module (mutually exclusive with -t) -c output test coverage report -h display this help message coverage deprecated, use -c instead
Congratulations! You have successfully installed XSpec!
To make the XSpec script more portable and invoke it from anywhere, set the environment variable $XSPEC_HOME
to the location where XSpec is stored and add a script invoking xspec.sh in /usr/bin
.