RE: [xsl] Dynamic path in xsl:import

Subject: RE: [xsl] Dynamic path in xsl:import
From: "SINGH Navpreet" <Navpreet.SINGH@xxxxxxxxx>
Date: Tue, 13 Sep 2005 07:09:42 +1000
Thanks Michael. You are right I do not need a dynamic path but

-----Original Message-----
From: Michael Kay [mailto:mike@xxxxxxxxxxxx]
Sent: Monday, 12 September 2005 5:58 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] Dynamic path in xsl:import

Using the term "dynamic" is perhaps unfortunate, as it suggests you want
do the import at run-time, which isn't possible. But I don't think
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
off-hand), you can write your own URIResolver that takes the URI
in the href attribute and returns a JAXP Source object containing the
stylesheet module. That gives you complete flexibility.

Michael Kay

> -----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