BOOKMARK & SHARE Bookmark and Share
The Future of Your Document Is Here
RenderX logo
Contact Us

Download Now!

RenderX offers all our software on a trial basis so that our prospects can easily see why thousands of customers have selected XEP to meet their needs.

Why not download a trial version today and see for yourself!

XEP Connector for Apache Cocoon

Version 2.1

Yuri Furman

Ashot Darbinian


XEP Connector for Apache Cocoon is a PDF/PostScript serializer for Cocoon 2.1.x, built upon RenderX XEP XSL FO (XSLFO) formatter. It generates PDF or PostScript documents from XSL Formatting Objects instances.


In order to use XEP Connector for Cocoon, you must install and configure the following components:


The connector's source code is in com/renderx/xepx/cocoon/*.java. We use Ant to build and install the serializer, details are in build.xml.

Before compiling, adjust values of the two properties at the top of the file, cocoon.dir and xep.dir. They must point to the Cocoon and XEP installation directories, respectively.

ant make.jar

will build build/XEPSerializer.jar.


To add the serializer to Cocoon, you must place XEPSerializer.jar into $COCOON_HOME/WEB-INF/lib, along with other libraries necessary to run XEP. Ant will take care of it, use install as the target:

ant install

You should have the rights to write to the directory; in multi-user environments, ask the system administrator to do this step for you.

After installing the files, restart Cocoon


Configuring PDF and PostScript Serializers

To use XEP Connector for Cocoon, add PDF and PostScript serializers to the global sitemap, replacing XEP_HOME with XEP-4.* installation directory:

	<map:serializers default="html">       
	<map:serializer mime-type="application/pdf" name="fo2pdf" 
		<parameter name="com.renderx.xep.CONFIG" type="string" 
	<map:serializer mime-type="application/postscript" name="fo2ps" 
		<parameter name="com.renderx.xep.CONFIG" type="string" 

With the serializers above, the following rule will server DocBook files as PDF documents.

	<map:match pattern="**.pdf">         
		<map:generate src="{1}.dbx"/>         
		<map:transform type="xslt"
		<map:serialize type="fo2pdf"/>       

For general information about serializers, see Cocoon's documentation at

Configuration Example

To ease adoption, we provide a sitemap example as examples/sitemap.xmap. Copy examples/hammer/ from the XEP's distribution into webapp directory of Cocoon, add the example sitemap.xmap there and edit the path to xep.xml, XEP configuration file. Now, fetch hammer/hammer.pdf from the server via HTTP - the serializer will automatically transform hammer.xml and hammer.xsl into PDF and serve it to you.