Sylvain Desvé pisze:
RESOLVED
I finally managed to do it. For those who encounter the same problem,
here's what I did.
1. I followed the tutorial at cocoon.apache.org
<http://cocoon.apache.org> abd created a block using maven
2. I created a source XML file and a XSLT 2.0 file
3. I edited sitemap.xmap and added a component :
<map:components>
<map:transformers default="xslt">
<map:transformer name="xslt-saxon" pool-grow="2" pool-max="32"
pool-min="8"
src="org.apache.cocoon.transformation.TraxTransformer">
<use-request-parameters>false</use-request-parameters>
<use-browser-capabilities-db>false</use-browser-capabilities-db>
<xslt-processor-role>saxon</xslt-processor-role>
</map:transformer>
</map:transformers>
</map:components>
4. I edited sitemap.xmap to add the pipeline
<map:pipeline>
<map:match pattern="test">
<map:generate src="test/mySource.xml" type="file" />
<map:transform src="style/myStyle.xslt" type="xslt-saxon" />
<map:serialize type="html" />
</map:match>
</map:pipeline>
5. I created an avalon directory in src/main/resources/META-INF/cocoon
and created a saxon-config.xconf file in it :
<?xml version="1.0" encoding="UTF-8"?>
<components>
<component logger="core.xslt-processor"
role="org.apache.excalibur.xml.xslt.XSLTProcessor/saxon"
class="org.apache.excalibur.xml.xslt.XSLTProcessorImpl">
<parameter name="use-store" value="true"/>
<parameter name="incremental-processing" value="false"/>
<parameter name="transformer-factory"
value="net.sf.saxon.TransformerFactoryImpl"/>
</component>
</components>
That's actually a general method for adding config that in 2.1.x was supposed to be put into
cocoon.xconf. This should be added to FAQ document but this in turn requires some work with our
documentation publishing system. :-(
6. I added the saxon dependency in the pom.xml
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>saxon</artifactId>
<version>8.7</version>
</dependency>
7. I ran mvn jetty:run and got to http://localhost:8888/myBlock1/test
and voilà !
That's it !
Thanks for sharing!
--
Grzegorz Kossakowski
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]