On Mon, 2007-01-15 at 15:45 +0000, Steve Odlind wrote:
> Hi all,
>
>
>
> How do I go about adding a custom fo.xsl in version 0.7? If I want a
> particular PDF to have a different look-and-feel to the other files in
> my site, how do I specify that this file should use a different fo.xsl
> to the other files?
>
The locationmap is letting you override the default one with your own
implementation:
from main/webapp/locationmap-transform.xml
<match pattern="transform.*.fo">
<select>
<location
src="{properties:skins-dir}{forrest:forrest.skin}/xslt/fo/{1}-to-fo.xsl" />
<location
src="{forrest:forrest.context}/skins/{forrest:forrest.skin}/xslt/fo/{1}-to-fo.xsl"/>
<location
src="{forrest:forrest.context}/skins/common/xslt/fo/{1}-to-fo.xsl"/>
</select>
</match>
Meaning if you place your xsl in
{properties:skins-dir}{forrest:forrest.skin}/xslt/fo/{1}-to-fo.xsl
then it get preference over the default ones.
>
> Having created the new fo.xsl, I have tried adding variants of the
> following to my project sitemap.xmap:
>
>
>
> “”
>
> <map:components>
>
> …
>
> <map:serializers>
>
> <map:serializer name="fo2pdf"
> src="org.apache.cocoon.serialization.FOPSerializer"
> mime-type="application/pdf" />
>
> </map:serializers>
>
> </map:components>
>
> …
>
> <map:match pattern="**aNewFile.xml">
>
> <map:generate src="{project:content.xdocs}{1} aNewFile.pdf" />
Hmm, not sure there is a space! {1} aNewFile.pdf
That could cause the error.
>
> <map:transform src="{project:resources}/myNewFile2fo.xsl" />
>
> <map:serialize type="fo2pdf" />
>
> </map:match>
>
> “”
>
>
>
> … all to no avail, as I get a java.lang.NullPointerException when I
> execute the ‘forrest’ command.
We would need some more information (stack trace) to see where the NPE
is coming from.
HTH
>
>
>
> Could someone point me in the right direction, please?
>
>
>
> Many thanks,
>
>
>
> Steve
>
>