You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Alexander Schatten <al...@gmx.at> on 2003/05/24 17:00:33 UTC

Re: relative paths

morten svanæs wrote:

> Hi,
>  
> I'm trying to get a css file loaded from a relative path inside a xslt 
> file like this:
>  
>     <link href="stylesheets/main.css" type="text/css" rel="stylesheet"/>
>  
> the sitemap is in:
> /cocoon/foo/bar
>  
> the sitemap loads the xslt file like this:
> <map:transform src="stylesheets/page2html.xsl">
>  
> But this don't work, so my question is: what is the root of the html 
> document
> served after the xslt transformation ?
> In other examples I see that contextPath is used,  but I don't 
> understand where
> it's defined and what it's value is.
>  

every document (type) Cocoon should serve must be declared in the 
sitemap, or to put it the other way round: for every document (off 
course also CSS, JAR, gif, jpg, ...) Cocoon should serve a matcher in 
the pipeline must be available that fits.

so you have to add something like this:

<map:match pattern="**.css">
   <map:read mime-type="text/css" src="style/{1}.css"/>
</map:match>

so that means, that everytime a CSS file is requested, this is searched 
in "<project>/style/...css"

e.g. in <link href="test/main.css" type="text/css" rel="stylesheet"/>
this is searched in "<project>/style/test/main.css"



alex


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org