Articles
More
Links
This document describes the adoption of the sitemap.xmap
for serving PDF documents.
As Cocoon provides an FO2PDF serializer, it shall be easy to publish documents as PDF.
Moreover there is already an document2pdf stylesheet
available used in the forrest project for transforming a
document xml to xsl:fo.
The sitemap declaration is simple, the URI space *.pdf
shall server the URI basename as PDF.
The PDF document shall contain only the mid-col-2
section document, so the aggregation step is skipped, and the xml
document file of section mid-col-2 is directly read by the
file generator.
Adding a new pdf related pipeline to the sitemap yields following sitemap snippet:
...
<map:pipeline>
<map:match pattern="*.pdf">
<map:generate src="docs/mid-col-2/{1}.xml"/>
<map:transform src="stylesheets/doc-v10-2fo.xsl"/>
<map:serialize type="fo2pdf"/>
</map:match>
</map:pipeline>
...
Moreover the site2html.xsl was adopted to create a link
in the mid-col-3 section for requesting the PDF version of the
current document. The name of the current page is passed from the
sitemap as sitemap parameter to the site2html.xsl having
sitemap parameter name page, and used as xslt parameter
named page.
PDF
pdf-tutorial
Hints
» Use Search to search all documents.
» Use Recreate Index to create the inital index.
This may be neccessary once at startup.
» Search and Recreate Index are available
at HTML Cocoon online deployment, only.
» Search and Recreate Index are not available
on WML online, WML offline, and HTML offline deployments.