Page 1 of 1

how to invoke Saxon-EE from ANT task within Oxygen?

Posted: Mon Sep 15, 2014 3:28 pm
by Ron Van den Branden
Hi,

I'm trying to configure an ANT task in a project file, that tries to invoke an XQuery 3.0 script via following ANT command:

Code: Select all


    <java classname="net.sf.saxon.Query" fork="yes">
<classpath>
<pathelement path="${oxygenlib}/saxon9ee.jar"/>
</classpath>
<!-- ... -->
</java>
I'm passing following jars to the ANT taks:

Code: Select all


<field name="extensionURLs">
<String-array>
<String>${oxygenHome}/classes/</String>
<String>${oxygenHome}/lib/oxygen.jar</String>
<String>${oxygenHome}/lib/oxygenAuthor.jar</String>
<String>${oxygenHome}/lib/oxygenDeveloper.jar</String>
<String>${oxygenHome}/lib/oxygenEclipse.jar</String>
<String>${oxygenHome}/lib/oxygenAuthorEclipse.jar</String>
<String>${oxygenHome}/lib/oxygenDeveloperEclipse.jar</String>
<String>${oxygenHome}/lib/resolver.jar</String>
<String>${oxygenHome}/lib/xercesImpl.jar</String>
<String>${oxygenHome}/lib/saxon9ee.jar</String>
<String>${oxygenHome}/lib/saxon.jar</String>
<String>${oxygenHome}/lib/xml-apis-ext.jar</String>
<String>${oxygenHome}/lib/log4j.jar</String>
</String-array>
</field>
Still, the XQuery 3.0 transformation fails, since ANT falls back on the unlicensed Saxon version which only supports XQuery 1.0:

Code: Select all


No license file found - running with licensable features disabled
I am definitely failing to invoke the right Saxon version (PE or EE). What should I do in order to invoke Saxon-PE or Saxon-EE from an ANT task running within Oxygen?

Best,

Ron

Re: how to invoke Saxon-EE from ANT task within Oxygen?

Posted: Mon Sep 15, 2014 3:46 pm
by Radu
Hi Ron,

Could you try the same thing removing the "fork="yes"" attribute from the <java> task?

The license for Saxon EE is bundled with the Oxygen libraries and we can license Saxon EE only if it is run directly in the ANT process started from Oxygen.

Regards,
Radu

Re: how to invoke Saxon-EE from ANT task within Oxygen?

Posted: Mon Sep 15, 2014 4:26 pm
by Ron Van den Branden
Hi Radu,

Thanks for your quick suggestion! The fork="yes" attribute was a relict of another task that needed to pass its own URIresolvers to Saxon. There's no need for that in this task, so it can be removed indeed. Here's the updated task that runs correctly:

Code: Select all


<java classname="net.sf.saxon.Query">
<arg value="-q:${pd}/xquery/test.xq"/>
<arg value="-qversion:3.0"/>
</java>
Note, how the -qversion parameter needs to be passed explicitly: otherwise the transformation still failed with this error:

Code: Select all


[java] Error on line 1 column 15 of test.xq:
[java] XQST0031 XQuery static error in #xquery version "3.0";#:
[java]XQuery 3.0 was not enabled when invoking Saxon
That's probably just a transient Saxon feature (which will go when XQuery 3.0 will be the default), but it's good to know if you need to run XQuery 3.0 from ANT.

Many thanks for helping me out!

Ron

Re: how to invoke Saxon-EE from ANT task within Oxygen?

Posted: Mon Sep 15, 2014 4:36 pm
by Radu
Hi Ron,

Possibly the default will never get changed:

http://www.saxonica.com/documentation/u ... dline.html

Code: Select all


-qversion:(1.0|3.0)

Specifies the XQuery language version supported. Default is "1.0". The value "3.0" is currently only available with Saxon-EE. It supports a fairly small subset of the features from the draft XQuery 3.0 specification (originally published as XQuery 1.1 but due to be renamed).
Regards,
Radu