[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] mulitple xsl:import from different directories

Subject: Re: [xsl] mulitple xsl:import from different directories
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Tue, 10 Jul 2012 09:09:33 +0100

You could implement Ken Holman's suggestion within a URIResolver. Register a compile-time URIResolver, and have it recognize the *.xsl appearing in the href argument. The URIResolver then returns a document containing a list of xsl:include elements for the file in the directory, wrapped in an xsl;stylesheet element.

What's the best way in Java of expanding the glob xsl_dir/*.xsl? The suggestion here:


is to use the DirectoryScanner class from Ant, but there are other ideas in that post that may be more practical.

Michael Kay

On 09/07/2012 22:57, Olivier XILLO wrote:

I have a master XSL file that need to include/import several xsl files located in a directory 'xsl_dir'.
However, I don't know in advance the number and names of xsl files.
So, I basically need to do something like :
<xsl:include href="xsl_dir/*.xsl"/>
I'm using XSLT2.0 with Saxon 9.3 HE.
Any idea on how I could achieve this ?

Current Thread