Installation on Mac and Linux - xspec/xspec GitHub Wiki
Requirements
Make sure requirements are complete.
Installation
For this installation the Saxon JAR (e.g. saxon-he-12.8.jar) is assumed to be in ~/saxon.
-
Extract the source code archive file of the latest
masterbranch, or alternatively clone themasterbranch of XSpec from GitHub:git clone https://github.com/xspec/xspec.gitFor this installation XSpec is assumed to be extracted or cloned to
~/xspec. -
Set up the Saxon environment variable. You can either set
SAXON_CPto the full classpath containing the Saxon jar file:export SAXON_CP=~/saxon/saxon-he-12.8.jaror, alternatively, set
SAXON_HOMEto the location of the Saxon jar file:export SAXON_HOME=~/saxonYou can check that the environment variable is set with:
echo $SAXON_CPSAXON_CPhas precedence overSAXON_HOME.If you want to make the change permanent, set the environment variable in your shell profile (e.g.
~/.bashrcor~/.bash_profile). -
Open a terminal, navigate to
~/xspec, make sure that the filebin/xspec.shis executable, and test the shell script with this command:bin/xspec.sh -hThe output should be the following usage summary:
Usage: xspec [-t|-q|-s|-c|-j|-catalog file|-h] file file the XSpec document -t test an XSLT stylesheet (the default) -q test an XQuery module (mutually exclusive with -t and -s) -s test a Schematron schema (mutually exclusive with -t and -q) -c output test coverage report (XSLT only) -j output JUnit report -catalog file use XML Catalog file to locate resources -e treat failed tests as error -h display this help message
Congratulations! You have successfully installed XSpec!
To make the XSpec script more portable and invoke it from anywhere, add a script invoking xspec.sh in /usr/bin. To move xspec.sh out of the XSpec installation directory, you must set the environment variable XSPEC_HOME to the location where XSpec is stored.