(This procedure is for both Saxon6.5 and Saxon8, tested Saxon9b with 2.1.8 and had no issues)
Add saxon8.jar to lib/local/. Note that with Cocoon 18.104.22.168 (and probably other versions as well) you need to remove the META-INF directory from the saxon jar, see this discussion for more info.
Edit src/webapp/WEB-INF/cocoon.xconf and declare the component for Saxon after the other xslt-processor components ...
Note: For Saxon7 and Saxon8 use "transformer-factory" net.sf.saxon.TransformerFactoryImpl and for Saxon6 use com.icl.saxon.TransformerFactoryImpl
Edit src/webapp/samples/hello-world/sitemap.xmap to add the "xslt-saxon" transformer ...
Add a sitemap match to use the xslt-saxon transformer ...
If you want to see Saxon being used then raise the ExploringTheLogs and look in core.log
There is a problem with XSP in combination with Saxon7. When the Saxon libraries are in your classpath, the root element of a page generated by XSP gets two extra namespace attributes:
This is only noticeable if the XSP generator is immediately followed by a serializer. In this case, Internet Explorer will complain: The namespace prefix is not allowed to start with the reserved string "xml". Firefox won't mind these namespace prefixes. A solution is to add an identity transformer (using Xalan or Saxon) after the generator.
Mailing list discussions
Some other discussion points (be careful, there are some furphies which may confuse you):
- Cocoon documentation: Trax/XSLT Transformer
- Discussion: Re: Transforming Big XML Files
- Discussion: Re: Multiple XSL Transformers
- Discussion: Re: Saxon and Cocoon
- Discussion: Re: default xsl transformer?
- Discussion: Re: BUG: EmptyStackException - Timothy Larson describes how he configured Saxon
- Discussion: Re: Using Saxon 7.9 with Cocoon? (note Vadim's comment about needing CVS version of excalibur-xmlutils)