How to use newest Saxon from ant transformation scenario?

Here should go questions about transforming XML with XSLT and FOP.
tmakita
Posts: 100
Joined: Fri Apr 08, 2011 7:58 am

How to use newest Saxon from ant transformation scenario?

Post by tmakita »

Hi,
This subject is already asked many times before, however I cannot use the newest Saxon 10.3 from my ant transformation scenario with Oxygen 23.1.

Here is the build file. I downloaded external Saxon add-on and it was successfully downloaded.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="build.attr.gen" default="attr.gen">
    <target name="attr.gen">
        <!-- ucd.all.flat.xml -->
        <property name="source.file" value="${basedir}${file.separator}..${file.separator}ucd.xml${file.separator}ucd.all.flat.xml"/>
        <makeurl property="source.file.url" file="${source.file}" validate="yes"/>
        <property name="dest.file" value="${basedir}${file.separator}attrlist.csv"/>
        <echo message="&lt;root/&gt;" file="${basedir}${file.separator}dummy.xml"/>
        <property name="dummy.file" value="${basedir}${file.separator}dummy.xml"/>
        
        <!-- XSLT Transformation Class Name -->
        <property name="transformer.classname" value="net.sf.saxon.Transform"/>
        <property name="prmInputFile" value="${dummy.file}"/>
        <property name="prmOutputFile" value="${dest.file}"/>
        <property name="prmStylesheetFile" value="${basedir}${file.separator}xsl${file.separator}gen_attr_list.xsl"/>
        <property name="oxyLibFolder" value="C:\PROGRA~1\OXYGEN~3.1\lib"/>
        <property name="oxyAntLibFolder" value="C:\PROGRA~1\OXYGEN~3.1\tools\ant\lib"/>
        <property name="saxonJar" value="C:\Users\toshi\AppData\Roaming\com.oxygenxml\extensions\v23.1\plugins\https_www.oxygenxml.com_InstData_Addons_default_updateSite.xml\oxygen-sample-plugin-transformer-saxon-10-0-23.1\lib\saxon-ee-10.0.jar"/>
        <property name="classpath" value="${oxyLibFolder}\oxygen.jar;${oxyLibFolder}\oxygen-basic-utilities.jar;${saxonJar};${oxyLibFolder}\log4j*.jar;${oxyAntLibFolder}\ant-apache-resolver.jar"/>
        <echo message="classpath=${classpath}"/>
        <java classname="net.sf.saxon.Transform" classpath="${classpath}">
            <arg value="-config:${basedir}${file.separator}saxon-config.xml"/>
            <arg value="-xsl:${prmStylesheetFile}"/>
            <arg value="-s:${dummy.file}"/>
            <arg value="-o:${dest.file}"/>
            <arg value="-t"/>
            <arg value="PRM_ATT_FILE_URL=${source.file.url}"/>
        </java>
    </target>
</project>
The output log:

Code: Select all

Executing:
"c:\program files\oxygen xml editor 23.1\jre/bin/java" -Dfile.encoding=UTF-8 -Xmx256m -Djava.awt.headless=true -classpath "C:\Program Files\Oxygen XML Editor 23.1\tools\ant/lib/ant-launcher.jar" "-Dant.home=C:\Program Files\Oxygen XML Editor 23.1\tools\ant" org.apache.tools.ant.launch.Launcher -f "build.xml" "-Dwebhelp.trial.license=no"

Buildfile: D:\My_Documents\download\UCD\attr-gen\build.xml

attr.gen:
     [echo] classpath=C:\PROGRA~1\OXYGEN~3.1\lib\oxygen.jar;C:\PROGRA~1\OXYGEN~3.1\lib\oxygen-basic-utilities.jar;C:\Users\toshi\AppData\Roaming\com.oxygenxml\extensions\v23.1\plugins\https_www.oxygenxml.com_InstData_Addons_default_updateSite.xml\oxygen-sample-plugin-transformer-saxon-10-0-23.1\lib\saxon-ee-10.0.jar;C:\PROGRA~1\OXYGEN~3.1\lib\log4j*.jar;C:\PROGRA~1\OXYGEN~3.1\tools\ant\lib\ant-apache-resolver.jar
     [java] Saxon-EE 10.3J from Saxonica
     [java] Java version 15.0.1
     [java] No license file found - running with licensable features disabled
     [java] URIResolver.resolve href="ahf_util_string.xsl" base="file:/D:/My_Documents/download/UCD/attr-gen/xsl/gen_attr_list.xsl"
     [java] Warning at xsl:mode on line 18 column 49 of gen_attr_list.xsl:
     [java]   SXST0068  Request for streaming ignored: this Saxon configuration does not support streaming
     [java] Warning at xsl:source-document on line 47 column 70 of gen_attr_list.xsl:
     [java]   SXST0068  Request for streaming ignored: this Saxon configuration does not support streaming
     [java] Stylesheet compilation time: 649.0473ms
     [java] Processing file:/D:/My_Documents/download/UCD/attr-gen/dummy.xml
     [java] Using parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
     [java] Building tree for file:/D:/My_Documents/download/UCD/attr-gen/dummy.xml using class net.sf.saxon.tree.tiny.TinyBuilder
     [java] Tree built in 0.2304ms
     [java] Tree size: 3 nodes, 0 characters, 0 attributes
     [java] Execution time: 22.6426ms
     [java] Memory used: 23Mb

BUILD SUCCESSFUL
Total time: 1 second

The process finished with exit code: 0
Saxon 10.3 does not recognize the license file and my XSLT stylesheet does not work at all.

Could you tell me some directions about this problem?

Regards,
--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to use newest Saxon from ant transformation scenario?

Post by Radu »

Hi Toshihiko,

I'm afraid this way of running an ANT build file from inside Oxygen with a licensed Saxon library works only with the Saxon 9 library bundled with Oxygen, it does not work with external Saxon libraries, like the one added by our add-on and we cannot make it work.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
gwolbers
Posts: 1
Joined: Wed May 05, 2021 8:56 pm

Re: How to use newest Saxon from ant transformation scenario?

Post by gwolbers »

Hi Radu and Toshihiko,

May I ask a similar question? I also need Saxon EE capabilities. For debugging I need to run it within Oxygen, so I bought a Saxon EE license. Can I use this with the installed Saxon-libraries? If so, where should I put the lic-file?

Regards,

Gerard Wolbers
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to use newest Saxon from ant transformation scenario?

Post by Radu »

Hi Gerard,

Oxygen's XSLT debugger is closely integrated with the Saxon libraries which come bundled with Oxygen. So you cannot make the XSLT debugger work with newer Saxon libraries, even if you have a license for them.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply