SaxonXQDataSource class is missing from the latest Saxon-HE 9.5.1-6 maven repository. The class existed in Saxaon-HE 9.5.1.4. In fact, the whole package net.sf.saxon.xqj seems to be missing in the latest 9.5.1-6 version. Did that class get moved and renamed somewhere?
3 Answers
The XQJ package was deliberately removed from the main saxon-he JAR file because it was pointed out to us by people who care about these things that the XQJ license is not "open source" in the strictest sense of the term; for open-source zealots it does not qualify because Oracle (who license it) insist that the interface cannot be modified, and that it cannot be distributed with an implementation unless the implementation passes all the compatibility tests. While these may seem perfectly sensible rules to you and me, it is a sufficient departure from open source principles for some people (e.g. some of the Lunix distributions) to disqualify the whole of Saxon-HE from getting their open-source stamp of approval.
It was our intent to contrinue to distribute the XQJ support in Saxon as a separate module for those who want it. However, I think that in the 9.5.1.6 build (and certainly in the Maven upload) we got this wrong, which is something we need to fix. In the meantime it remains part of Saxon-PE and Saxon-EE (and you can always use those JAR files, without a license, provided you don't try to use PE- or EE- specific functionality).

- 156,231
- 11
- 92
- 164
As mentioned (in answer 1) XQJ has been moved into a separate jar file. However, tt is in fact available in Saxon-HE in the usual places (i.e. SourceForge and on Maven).
For maven the file name is given as Saxon-HE-9.5.1-6-xqj.jar
See Saxon-HE Maven respository: http://repo1.maven.org/maven2/net/sf/saxon/Saxon-HE/9.5.1-6/

- 691
- 6
- 10
-
The issue is that i'm using maven pom.xml that has dependency as:
net.sf.saxon Saxon-HE 9.5.1-6 -
I am not too sure how it works. I will investigate and get back to you. – ond1 Sep 08 '14 at 16:01
-
Hi ond1, where you able to find out how i can get the latest Saxon HE via maven with the latest XQJ dependency jar? Where you able to fix the issue? – Tom Sep 17 '14 at 20:17
-
1Sorry for the delay in replying. You should be able to specify the classifier of the jar you want in the dependency. See: http://stackoverflow.com/questions/4336251/change-maven-dependency-for-artifact-using-classifier – ond1 Oct 31 '14 at 12:30
-
1If using Gradle, the maven dependency with classifier can be declared as `compile 'net.sf.saxon:Saxon-HE:9.5.1-6:xqj'`. – Going Bananas Nov 26 '15 at 16:38
-
Did this really work for you? I tried to use saxon version 9.8.0-14 with `
xqj ` and I can access the DataSource via `import com.saxonica.xqj.SaxonXQDataSource;`. However, during runtime I get the runtime error: `java.lang.NoClassDefFoundError: net/sf/saxon/om/SpaceStrippingRule`. I guess because it tries to lookup for `net/sf/saxon/` whilst it is `com/...` – Vegaaaa Jul 05 '19 at 09:26
Two things need to be done in order to upgrade Saxon-HE beyond version 9.5.
In case of Gradle add compile "net.sf.saxon:Saxon-HE:$saxonHeVersion:xqj"
just below compile "net.sf.saxon:Saxon-HE:$saxonHeVersion"
. For Maven you need to use <classifier>xqj<classifier>
.
In Java code change import net.sf.saxon.xqj.SaxonXQDataSource;
to import com.saxonica.xqj.SaxonXQDataSource
.

- 10,475
- 7
- 58
- 103
-
Did this really work for you? I tried to use saxon version 9.8.0-14 with `
xqj ` and I can access the DataSource via `import com.saxonica.xqj.SaxonXQDataSource;`. However, during runtime I get the runtime error: `java.lang.NoClassDefFoundError: net/sf/saxon/om/SpaceStrippingRule`. I guess because it tries to lookup for net/sf/saxon/ whilst it is com/... – Vegaaaa Jul 05 '19 at 09:26 -
It really worked for me and I don't know what else you may still have wrong – Michal Kordas Jul 18 '19 at 10:37
-
I have no idea. Just updated the maven repository as you stated, nothing more, and the error was thrown even after rebuilding the project. Am using version 9.5.1-4 due to this. – Vegaaaa Jul 19 '19 at 14:14