You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "BLAND, Geoff, GBM" <Ge...@rbos.com> on 2006/04/21 15:23:51 UTC
Problem with the xsl:import
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:
http://www.rbos.com
http://www.rbsmarkets.com
***********************************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Problem with the xsl:import
Posted by Marc Farrow <ma...@gmail.com>.
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" />
HTH
On 4/21/06, BLAND, Geoff, GBM <Ge...@rbos.com> 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:
> http://www.rbos.com
> http://www.rbsmarkets.com
>
> ***********************************************************************************
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
--
Marc Farrow