You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mark Milbourne Foster City <Ma...@efi.com> on 2001/01/12 07:19:50 UTC
Cascading stylesheets that are in different directories?
I have a problem that maybe someone has a better solution for than the one
I've found.
I have an XML file that is using a stylesheet from a different directory.
The directory its in is /ppg/articles/website and the stylesheet is in /ppg.
Now if I use ../../Page.xsl then all is ok.
<?xml-stylesheet href="../../Page.xsl" type="text/xsl"?>
But the Page.xsl is cascading its output to another stylesheet in the same
directory. If I simply include the stylesheet with the line;
<xsl:processing-instruction name="xml-stylesheet">href="Document.xsl"
type="text/xsl"</xsl:processing-instruction>
then it doesn't work. On my win2K installation of Cocoon 1.7.4 I can do the
following;
<xsl:processing-instruction name="xml-stylesheet">href="/Document.xsl"
type="text/xsl"</xsl:processing-instruction>
and that seems to work. BUT on a Linux box with Cocoon 1.8 installed this
doesn't work. I read somwhere that using / means that the root of the
current context. Is this correct? 1.8 seems to have changed.
What I found worked was;
<xsl:processing-instruction
name="xml-stylesheet">href="http://localhost/ppg/Document.xsl"
type="text/xsl"</xsl:processing-instruction>
But its not very nice.
Am I doing this the hard way? Does someone else have the same problem?
Any suggestions would be helpful.
Thanks.
_____
Mark Milbourne
Electronics for Imaging.
Production Printing.
Re: Cascading stylesheets that are in different directories?
Posted by Ludovic Maitre <Lu...@sophia.inria.fr>.
Mark Milbourne Foster City wrote:
> <xsl:processing-instruction name="xml-stylesheet">href="/Document.xsl"
> type="text/xsl"</xsl:processing-instruction>and that seems to work.
> BUT on a Linux box with Cocoon 1.8 installed this doesn't work. I
> read somwhere that using / means that the root of the current
> context. Is this correct? 1.8 seems to have changed.What I found
> worked was;<xsl:processing-instruction
> name="xml-stylesheet">href="http://localhost/ppg/Document.xsl"
> type="text/xsl"</xsl:processing-instruction>But its not very nice.Am I
> doing this the hard way? Does someone else have the same problem?Any
> suggestions would be helpful.Thanks.
> -----------------------------------------------------------------------
>
Try using ./ before the url of the stylesheet rather than / :
<xsl:processing-instruction name="xml-stylesheet">href="./Document.xsl"
type="text/xsl"</xsl:processing-instruction>
--
Ludovic.Maitre@sophia.inria.fr
INRIA - 2004 route des lucioles - BP 93 Tel: (33/0) 4 92 38 50 41
06902 SOPHIA-ANTIPOLIS cedex (France) Fax: (33/0) 4 92 38 76 02