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

RE: [xsl] Dynamic path in xsl:import


Subject: RE: [xsl] Dynamic path in xsl:import
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 12 Sep 2005 08:58:02 +0100

Using the term "dynamic" is perhaps unfortunate, as it suggests you want to
do the import at run-time, which isn't possible. But I don't think that's
what you need here.

First, try to do it with relative URIs. So long as all the stylesheet
modules have the same relative locations in the two directory structures
this should work fine.

If there's some reason relative URIs won't do the job (I can't think of one
off-hand), you can write your own URIResolver that takes the URI specified
in the href attribute and returns a JAXP Source object containing the
stylesheet module. That gives you complete flexibility.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: SINGH Navpreet [mailto:Navpreet.SINGH@xxxxxxxxx] 
> Sent: 12 September 2005 00:33
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Dynamic path in xsl:import
> 
> Hi,
> Developing an application that uses number of xslt files to 
> transform XML. Main XSLT file has many xsl:import statements. 
> Application needs to be deployed on the tomcat server. Tomcat 
> could be on installed on separate location on two different 
> machines. How can I give a dynamic path for child xslt files 
> in the xsl:import statements depending upon server location?
> Thanks,
> Navpreet. 


Current Thread
Keywords