Page 1 of 1

Using SAXON EE License in ANT Transformation

Posted: Thu Jan 05, 2017 8:10 pm
by jonas
Hi all,

I have an ANT with multiple target. I'm running the ANT transformation in oXygen (18.0) using an ANT Transformation Scenario.
The ANT file contains the following Java task to start an XSL transformation with Saxon EE:

Code: Select all


        <java classname="net.sf.saxon.Transform" classpath="${oxyFolder}\lib\saxon9ee.jar; ${oxyFolder}\lib\resolver.jar" clonevm="true">
<arg value="-r:org.apache.xml.resolver.tools.CatalogResolver"/>
<arg value="-x:org.apache.xml.resolver.tools.ResolvingXMLReader"/>
<arg value="-y:org.apache.xml.resolver.tools.ResolvingXMLReader"/>
<arg value="-it:createFile"/>
<arg value="-xsl:xslt${file.separator}collectElementIDs.xsl"/>
<arg value="-t"/>
<arg value="-val:lax"/>
<arg value="TOPICLIST=${TopicFiles}"/>
<arg value="OUTFOLDER=${outFolder}"/>
</java>
The {oxyFolder} variable points to the oXygen installation directory.
The XSL transformation works, but I get the following notification: [java] No license file found - running with licensable features disabled.

I know that the Saxon EE license from oXygen is not available, when I run the ANT file outside oXygen. But can I use the Saxon EE license when I run an ANT transformation scenario in oXygen?

Best regards,
Jonas

Re: Using SAXON EE License in ANT Transformation

Posted: Mon Jan 09, 2017 11:48 am
by adrian
Hi,

The classpath needs to specify the oxygen.jar (or oxygenAuthor.jar, or oxygenDeveloper.jar) before saxon9ee.jar, in order for the Saxon-EE license to work. In addition Oxygen requires a few additional jars, xercesImpl.jar, log4j.jar. So, your classpath would look like this:

Code: Select all

classpath="${oxyFolder}\lib\oxygen.jar;${oxyFolder}\lib\saxon9ee.jar;${oxyFolder}\lib\log4j.jar;${oxyFolder}\lib\xercesImpl.jar;${oxyFolder}\lib\resolver.jar"
I would also recommend using fork="true", or you'll get some security exceptions.

Regards,
Adrian