ProjectPathModule provides relative and absolute paths with regards to the root of a project.
Config:
<component-instance logger="core.modules.input"
name="myproject"
class="org.apache.cocoon.components.modules.input.ProjectPathModule">
<uri-prefix>my/project/</uri-prefix>
</component-instance>
Usage:
<map:transform src="skins/{forrest:skin}/xslt/fo/document2html.xsl">
<map:parameter name="base" value="{myproject:relative}"/>
</map:transform>
And then prepend this to all image paths:
...
<xsl:param name="base"/>
...
<xsl:template match="img">
<img src="{concat($base, @src)}" ...
...
</xsl:template>
Then if you are in my/project/some/folder/page.html, the image will have a relative path bact to the root of the project.
<img src="../../imagename.png"/>
Using 'myproject:path' would have given you: /some/folder/page.html
Using 'myproject:folder' would have given you: /some/folder/
version: $Id$ |