[Home] [By Thread] [By Date] [Recent Entries]

Subject: Re: xsl:package use question
From: "Mukul Gandhi mukulg@xxxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 10 Feb 2026 08:53:00 -0000
Hi Alan,
    Thanks for answers to the questions that I've asked. This helps me a
lot.

On Tue, Feb 10, 2026 at 11:51b/AM Alan Painter alan.painter@xxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:


> One of the things that is required for using XSLT packages is that you
> need to set up the processor to find them.
>
> I can offer an example: the project 'ajp' is an XSLT package for which an
> example XSLT then uses the package:
>
> https://github.com/xmljacquard/ajp
>
> In SaxonHE for java, you need to compile the innermost packages first and
> then add them to the compiler to compile the using packages, up to the
> outermost using package.
>
> As an example from
>
https://github.com/xmljacquard/ajp/blob/main/src/main/java/org/xmljacquard/aj
p/XsltXpathEnvironment.java
>
> The inner package is compiled specially using "compilePackage()" and then
> imported into a compiler using "importPackage()".
>
>     public static XsltCompiler getXsltCompiler(final Processor processor)
> throws SaxonApiException {
>         final XsltCompiler compiler    = processor.newXsltCompiler();
>         final XsltPackage  xsltPackage =
> compiler.compilePackage(getPackageSource());
>         compiler.importPackage(xsltPackage);
>         return compiler;
>     }
>
> The returned compiler is then used to compile the "using" package.
>
> I'm hoping that helps and best regards
>
> -alan
>



--
Regards,
Mukul Gandhi

Current Thread
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member