Bug #3726


Saxon License not being picked up relative to library file

Added by O'Neil Delpratt over 5 years ago. Updated 9 months ago.

Saxon-C Internals
Start date:
Due date:
% Done:


Estimated time:
Found in version:
Fixed in version:


According to the documentation:

Location of the Saxon license file for commercial products: Saxon/C looks in the path relative to where the main library has been installed. For example, in '/usr/lib', if this is where libsaxon[EDITION] has been installed. Alternatively, Saxon also looks for the license according to the environment variable SAXONC_HOME, if this has been set. 

After inspecting the code it seems to me that the license Verify class does not look in the directory relative to the main library. Therefore the license file can only be picked up either by the setting of the SAXONC_HOME environment variable or by placing the license file relative to the XSLT stylesheet.

Actions #1

Updated by O'Neil Delpratt 10 months ago

  • Description updated (diff)

The text on the license file location is outdated:

Actions #2

Updated by Debbie Lockett 9 months ago

This bug was originally raised 5 years ago against Saxon/C 1.1. There were two public releases in this series: 1.1.0 on 2017-09-27, and 1.1.2 on 2019-02-21. The next release was the next major release 1.2.0 on 2019-10-16. I don't know where to look in the source code to see if this bug with the Verifier was fixed before the 1.1.2 or 1.2.0 releases.

Since 1.2, in the SaxonC documentation (as opposed to the "License" section of the saxon-c/index.xml webpage which has indeed been neglected, so it is no longer consistent with the documentation) we document that SaxonC looks for the license key: "in the path relative to where the main library has been installed"; "according to the environment variable SAXONC_HOME"; and "Alternatively the licenseFileLocation configuration property can be used to provide the license location".

Do we now run any tests to check that these mechanisms all work?

Actions #3

Updated by Debbie Lockett 9 months ago

Comparing to the main Saxon documentation (!about/license/licensekey), I suggest that we update the SaxonC documentation at!starting/licensing as follows:

Location of the Saxon license file

SaxonC will search for the license key in the following locations:

  1. If you supply a Saxon configuration file, the location given in the licenseFileLocation attribute of the outermost configuration element in this file.

  2. The location specified using the configuration property licenseFileLocation.

When this configuration property is set, Saxon will immediately attempt to load the specified file, avoiding any subsequent attempt to search for it on the classpath and elsewhere.

See Configuration for more details about setting configuration properties with SaxonC. For example, to provide the licenseFileLocation in PHP:

$saxonProc = new Saxon\SaxonProcessor(true);
$saxonProc->setConfigurationProperty("", "/usr/lib/saxon-license.lic");
  1. The directory where the main SaxonC library has been installed.

For example on Linux, in /usr/lib if this is where libsaxon-[EDITION]c-[VERSION].so has been installed.

  1. The directory identified by the environment variable SAXONC_HOME.
Actions #10

Updated by Debbie Lockett 9 months ago

SaxonC documentation update (in section starting/licensing, as suggested in #note-3) committed on saxon12 and main branches. The online SaxonC 12 documentation will be updated with the next maintenance release.

I have also added details relevant for SaxonC in the main Saxon documentation section about finding the license key (about/license/licensekey). Again, this Saxon 12 documentation will be updated online with the next maintenance release.

The "License" section on the SaxonC webpage ( has also been updated and corrected to match this information in the documentation.

Please register to edit this issue

Also available in: Atom PDF