tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "BLAND, Geoff, GBM" <>
Subject RE: Problem with the xsl:import
Date Tue, 25 Apr 2006 11:14:46 GMT

Thanks for the reply.

We can put in an import of the form

<xsl:import href="http://localhost/aaem/xsl/routesummarycontent.xsl" />

and that works fine (for a single web server).

But we have multiple web servers on the box (using different ports and
different install paths) and they may be different versions (development,
UAT, production) having different versions of routesummarycontent.xsl. If we
use the import above all servers end up selecting the XSL for just one of
the versions. 

We don't want to have a different import for each version either as that
will need modifying as we migrate updated versions between servers.

What we need is a "relative" import, for example, 

<xsl:import href="/xsl/routesummarycontent.xsl" />  <!-- doesn't work -->

But I'm thinking this is impossible.


-----Original Message-----
From: Marc Farrow [] 
Sent: 21 April 2006 14:41
To: Tomcat Users List
Subject: Re: Problem with the xsl:import

You need to put the XML import file (in your case routesummarycontent.xsl)
somewhere that whomever is providing the resource (Apache or Tomcat) can see
it.  Let me try to elaborate.

We use an AJP connector with Tomcat and receives requests from Apache on
port 8009.  We forward all "Servlet" stuff to the Tomcat, but we let Apache
handle everything else.  Even images, js files, etc that are contained
within a web application (context).  In order to accomplish this, we have an
alias set up for each web application in Apache.  Thus, when we go to
http://localhost/mywebapp/js/myjsfile.js we know that Apache is pulling up
that page.  However, if we have a js file in a JSP page that is referenced
such as

<script src="/mywebapp/js/myjsfile.js" language="Javascript"></script>

we know that Tomcat is processing the JSP page, but Apache is processing the
handling of sending the JS file to the client.  As this is another "http"
request inside the page that was request.

So, the short of it is that you need to place your XSL somewhere that can be
accessed via HTTP.  So you need to either move the XSL file to a place where
an alias is defined for Apache (even root) or create an alias for your
Tomcat context and then point your html tag to:

<xsl:import href="http://localhost/aaem/xsl/routesummarycontent.xsl" />


On 4/21/06, BLAND, Geoff, GBM <> wrote:
> Using Apache Tomcat 5.0.28 I'm having a problem with the xsl:import 
> command.
> I have several Tomcat running on the same server (they could be 
> different releases of code so can't share resources).
> An XSLT script is called via a JSP to convert XML to HTML (<xsl:apply 
> nameXml="routesummary" xsl="/xsl/routesummaryheader.xsl" />).
> This routesummaryheader.xsl script then needs to call another XSLT 
> script routesummarycontent.xsl and it does this via an import, for 
> example,
> <xsl:import 
> href="http://localhost:8080/aaem/xsl/routesummarycontent.xsl"
> />
> Now this works fine.
> But I run many Tomcat servers on this box and so a specific URI is no 
> good. So I want to replace that import with a relative URI
> <xsl:import href="routesummarycontent.xsl" />
> This does not work, I get "Had IO Exception with stylesheet file: 
> routesummarycontent.xsl".
> Note routesummaryheader.xsl and routesummarycontent.xsl are in the 
> same directory.
> I've tried all kinds of relative paths in the import nothing seems to 
> work.
> The JSP file is under webapps\app-dir\jsp. The XSLT files are under 
> webapps\app-dir\xsl.
> How do I fix this?
> **********************************************************************
> *************
> The Royal Bank of Scotland plc. Registered in Scotland No 90312.
> Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
> Authorized and regulated by the Financial Services Authority
> This e-mail message is confidential and for use by the addressee only. 
> If the message is received by anyone other than the addressee, please 
> return the message to the sender by replying to it and then delete the 
> message from your computer. Internet e-mails are not necessarily 
> secure. The Royal Bank of Scotland plc does not accept responsibility 
> for changes made to this message after it was sent.
> Whilst all reasonable care has been taken to avoid the transmission of 
> viruses, it is the responsibility of the recipient to ensure that the 
> onward transmission, opening or use of this message and any 
> attachments will not adversely affect its systems or data. No 
> responsibility is accepted by The Royal Bank of Scotland plc in this 
> regard and the recipient should carry out such virus and other checks 
> as it considers appropriate. Visit our websites at:
> **********************************************************************
> *************
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Marc Farrow

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message