Packaging Module/Saxon

From EXPath Community Group

The implementation of the Packaging Module for Saxon, and more generally the standard on-disk repository manager.

Todo

  • Adapt to the latest draft.

Saxon 9.3

Adapting the support to the new Saxon 9.3 is harder than excepted. Because several classes have been renamed in Saxon 9.3, especially the broadly used ones. The goal is to centralize them in the package net.sf.saxon.lib, which is good if followed from the beginning, but breaks compatibility (especially when introduced in a minor version release). In particular, the class ExtensionFunctionDefinition has been moved to this package, making all existing extensions unusable!

So beyond adapting pkg-saxon, that's a full strategy to migrate to Saxon 9.3 that we need. Maintaining compatibility within the same software components (as it was in pkg-saxon and several extension libraries, supporting Saxon from 8.8 to 9.2) is not possible anymore.

This directory contains preliminary work, but I decided to revert it back and drop the support for 9.3 waiting for a stable and well thought solution (which will probably be dropping support for older versions once Saxon 9.3 becomes mainstream). In particular:

(To be continued...)

Setup project

The projects in the Packaging System Subversion repository are Netbeans projects. There is the project pkg-saxon dedicated to supporting the Packaging System on Saxon, and the project pkg-repo, which provides Java support for on-disk repositories. It is then used by the former project, but is not dedicated to Saxon itself.

The project pkg-repo has the following dependencies:

  • a Java platform named JDK_1.6

The project pkg-saxon has the following dependencies:

  • a Java library named saxon-he
  • a Java platform named JDK_1.6

Ensure you have the correct Java platform by having a look in Tools -> Java Platforms. If the correct platform does not exist, click Add Platform..., and select the correct Java home directory on your system (the one containing the bin subdirectory), then Next >, then be sure to set the correct name, then Finish.

To create the library, go to Tools -> Libraries, click New Library... and type in the library name: saxon-he. Add the JAR file saxon9he.jar, from the latest Saxon-HE archive downloadable from this webpage.

Then just open both projects: File -> Open Project and select the project directory, [trunk-dir]/repo/pkg-repo/ (resp. [trunk-dir]/saxon/pkg-saxon/).

The project pkg-saxon is a bit special, as it supports several versions of Saxon (from 8.8 to 9.2). Some classes are dedicated to a specific version, so the build process needs 5 specific JAR files. Download Saxon B 8.8, 8.9, 9.0 and 9.1, and Saxon HE 9.2. Then add the following lines to [trunk-dir]/saxon/pkg-saxon/nbproject/private/private.properties (adapt the paths, of course):

saxon88.jar=/Library/Java/com/saxonica/saxonb8-8-0-7j/saxon8.jar
saxon89.jar=/Library/Java/com/saxonica/saxonb8-9-0-4j/saxon8.jar
saxon90.jar=/Library/Java/com/saxonica/saxonb9-0-0-8j/saxon9.jar
saxon91.jar=/Library/Java/com/saxonica/saxonb9-1-0-8j/saxon9.jar
saxon92.jar=/Library/Java/com/saxonica/saxonhe9-2-0-3j/saxon9he.jar

You need to have at least one of those. A full release needs all of them! Check the build messages to be sure which versions have been actually taken into account.

If you want to build from the command line, using Ant without NetBeans, you need to pass the Java home, the Saxon library and the JUnit library. For instance (adapt the actual paths):

ant \
  -Dplatforms.JDK_1.6.home=/.../java-sdk-6 \
  -Dlibs.saxon-he.classpath=/.../saxon9he.jar \
  -Dlibs.junit_4.classpath=/.../junit-4.0.jar

The JUnit library is necessary only if you run tests. To just build the JAR, add the option jar at the end of the above command. The above ant command is valid for both pkg-repo and pkg-saxon (the former does not need the Saxon library though).