XSLT 3.0 packages in Saxon 9 and 10

Jeremy Cronk <[email protected]> Mon, 11 Jan 2021 17:45:28 +0000
Newsgroups gmane.text.xml.saxon.help
Message-ID <BYAPR10MB3414D6A9E6A056F5B9AEC5F6BDAB0@BYAPR10MB3414.namprd10.prod.outlook.com>
Hi,

I’ve spent a lot of time experimenting and reading the API docs and I’m confused, so I’ll just ask: What’s the “preferred” way in Saxon to load a set of XSLT package files (say, from a jar file) for use in transformations?  I see you can compile and add packages with XsltCompiler, but it looks like it would make more sense to use a PackageLibrary.  However, I haven’t successfully been able to add packages to one, so I’m sure I’m missing something really obvious.  If I call addPackage and pass in an .xsl file as a File, it doesn’t complain, but if I call getPackages on the same PackageLibrary, it returns an empty list.  It looks like the same thing happens with .sef files.

Is there something like “XSLT 3.0 Packages for Absolute Morons” out there somewhere that I could read and follow?  I’m having trouble understanding the intent of the different ways to load packages, not to mention the issue of getting it to work.  What I’d love to be able to do is store the SEF files in a jar and load everything in the jar as a package, and it looks like in order to do that, I need to compile them with “relocatable” turned on, stick them in a jar, and then…something with PackageLibrary?

Also, is it correct to say that a package compiled on Saxon 9 won’t work on Saxon 10?  When I tried this, I got a NPE, but after compiling the stylesheet with Saxon 10, it worked fine (on 10; I didn’t try it again on 9).

Jeremy

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[email protected]
https://lists.sourceforge.net/lists/listinfo/saxon-help