Project

Profile

Help

Package library path with Ant

Added by Robert Kirkpatrick almost 6 years ago

Hello, I just registred to the community to report the following issue:

I've been using command-line Saxon for some time with the -lib switch to locate xsl packages (Saxon-HE-9.9 on Windows10)

Now I intend to reorganize my project with Ant, and I can't find a corresponding feature, ie. specifying library paths outside the main xslt, without explicit xsl:include/import.

TIA for any assistance, Robert.


Replies (7)

Please register to reply

RE: Package library path with Ant - Added by Michael Kay almost 6 years ago

Good question. There isn't any way of setting this up using configuration or TransformerFactory properties. I think your best approach is to define the library packages in a configuration file, and nominate the configuration file using the property "http://saxon.sf.net/feature/configuration-file"

Here's the example of package info in the configuration file from the documentation:

<xsltPackages>
    <package name="http://package.one/" version="1.0" sourceLocation="packageOne.xsl" 
      exportLocation="packageOne.sef"/>
    <package name="http://package.one/" version="2.0-beta" sourceLocation="2.0beta/packageOne.xsl" 
      exportLocation="2.0beta/packageOne.sef"/>
    <package name="http://package.two/" version="8.6.3" sourceLocation="packageTwo.xsl">
       <withParam name="debug" select="true()"/>
       <withParam name="maxTransactions" select="300"/>
    </package>
  </xsltPackages> 

and the documentation is here:

http://www.saxonica.com/documentation/index.html#!configuration/configuration-file/config-xsltPackages

RE: Package library path with Ant - Added by Robert Kirkpatrick almost 6 years ago

Many thanks for your quick reply.

But unfortunately, your solution is not applicable to Saxon-HE !?

Robert.

RE: Package library path with Ant - Added by O'Neil Delpratt almost 6 years ago

In Ant could try and use the exec task.

For example:

  <!-- XMarkBenchmark sample test, requires EE (takes approx 6 mins) -->
    <target name="test-samples-XMarkBenchmark-j" depends="samples-j" description="Run test of XMarkBenchmark sample">

        <exec executable="java"
              dir="${build-resources.dir}/samples"
              failonerror="true">
            <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes${Z}${basedir}/${build-hej.dir}/saxon9he.jar${Z}${license.dir}"/>
            <arg line="ee/XMarkBenchmark"/>
            <arg line="-dir:${xmark.dir}"/>
            <arg line="-sa"/>
        </exec>
    </target>

RE: Package library path with Ant - Added by Robert Kirkpatrick almost 6 years ago

@Michael:

Hopefully it does not!

Following the docs which comment every configuration feature as PE or EE restricted, I started looking for work-arounds.

Then I received your message and created a config file, which worked fine.

So very nice indeed - but is this officially supported in HE?

(I would get a PE license if necessary)

Robert.

RE: Package library path with Ant - Added by Michael Kay almost 6 years ago

Certainly, configuration files are supported in HE.

With HE you can load packages in either source (XSL) or compiled (SEF) format.

But you need EE to create a package in compiled (SEF) format.

RE: Package library path with Ant - Added by Debbie Lockett almost 6 years ago

Bug raised for required 9.9 documentation updates https://saxonica.plan.io/issues/4138

    (1-7/7)

    Please register to reply