As Mike said, this area is definitely 'work in progress'. In particular
this problem arises from inter-package dependencies conflicting with the
compiling order of the stylesheet/packages presented in the current 9.6.
For the moment, depending upon your situation, one of the following
actions may help:
1. Ensure that *every* package is required, i.e. the stylesheet can be
compiled only if every one of the supplied packages will be used. (If
you're trying using different package-version alternates, only the first
will be used and any subsequent ones will be compiled as 'separate
stylesheets' and may cause this NPE)
2. Try putting the principal stylesheet as the *last* in the semi-colon
separated list. Currently it will then be compiled last when essentially
every other package has already been compiled into the library.
Personally I'd try the second option as it's the easiest. As I said,
we're looking into this area, but the implementation is still experimental.
John
On 19/10/2014 01:37, Dimitre Novatchev dnovatchev(_at_)gmail(_dot_)com wrote:
It almost worked from the command line, but this time I got:
C:\xml\XSLT3.0>"C:\Program Files\Java\jre7\bin\java.exe" -Xms1024M
-Xmx1024M -jar C:\xml\Parsers\Saxon\Ver.9.6\saxon9ee.jar -t
-repeat:1 t.xml using-package.xsl;complex-arithmetic.xsl
Saxon-EE 9.6.0.1J from Saxonica
Java version 1.7.0_51
Using license serial number Vxxxxxxxxxxxxxx
Generating byte code...
java.lang.NullPointerException
at net.sf.saxon.trans.PackageLibrary.getPackage(PackageLibrary.java:75)
at
com.saxonica.ee.packages.StylesheetPackageEE.spliceUsedPackage(StylesheetPackageEE.java:61)
at
com.saxonica.ee.packages.StylesheetPackageEE.spliceUsePackages(StylesheetPackageEE.java:43)
at
net.sf.saxon.style.StylesheetPackage.preprocess(StylesheetPackage.java:371)
at net.sf.saxon.style.Compilation.compilePackage(Compilation.java:180)
at
net.sf.saxon.s9api.XsltCompiler.compilePackage(XsltCompiler.java:394)
at
net.sf.saxon.s9api.XsltCompiler.compilePackages(XsltCompiler.java:447)
at net.sf.saxon.Transform.doTransform(Transform.java:582)
at net.sf.saxon.Transform.main(Transform.java:80)
Fatal error during transformation: java.lang.NullPointerException: (no message)
Cheers,
Dimitre
On Sat, Oct 18, 2014 at 4:58 PM, Michael Kay<mike(_at_)saxonica(_dot_)com>
wrote:
>If you are running from the command line, it is possible to load multiple
packages by providing a semicolon-separated list of filenames in the -xsl
parameter. However, I don't think this is well documented or tested and it may
have restrictions concerning the order of packages.
>
>What is documented and tested is using packages via the s9api XsltCompiler
interface; essentially you can compile a package into a CompiledPackage object,
and then make this available to an XsltCompiler using an importPackage method.
>
>This is a bit of a stopgap; packages are work in progress. We're thinking about
"classpath-like" mechanisms for the longer term.
>
--
*John Lumley* MA PhD CEng FIEE
john(_at_)saxonica(_dot_)com <mailto:john(_at_)saxonica(_dot_)com>
on behalf of Saxonica Ltd
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--