xsl-list
[Top] [All Lists]

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

2012-07-09 17:53:15
At 2012-07-09 23:57 +0200, 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 ?

Use XSLT to create a single file of multiple <xsl:include> statements by using Saxon's implementation of collection(), and then have a single <xsl:include> in your stylesheet that includes the generated file.

I can't see a way of doing it all at compile time ... I'm sure you'll need the pre-step of creating the intermediate file of include statements. At least you won't have to change your stylesheet as the one include need never change.

I hope this helps.

. . . . . . . . . . Ken


--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Oct 2012
Contact us for world-wide XML consulting and instructor-led training
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/
G. Ken Holman                   mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>