Skip to content

Instantly share code, notes, and snippets.

@kardeiz
Last active June 28, 2016 18:46
Show Gist options
  • Save kardeiz/9741159 to your computer and use it in GitHub Desktop.
Save kardeiz/9741159 to your computer and use it in GitHub Desktop.
Using Saxon with Cocoon XSLT for DSpace

Using Saxon with Cocoon XSLT for DSpace

Create an xconf file at [dspace-src]/dspace/modules/xmlui/src/main/resources/META-INF/cocoon/avalon/cocoon-core-saxon-xslt.xconf and add the following lines:

<?xml version="1.0" encoding="UTF-8"?>
<components>
  <component role="org.apache.excalibur.xml.xslt.XSLTProcessor/saxon"
    class="org.apache.cocoon.components.xslt.TraxProcessor">
    <parameter name="use-store" value="true"/>
    <parameter name="transformer-factory" value="net.sf.saxon.TransformerFactoryImpl"/>
  </component>
</components>

Add the following lines to [dspace-src]/dspace/modules/xmlui/pom.xml (or modify with your version of Saxon):

<dependency>
  <groupId>net.sf.saxon</groupId>
  <artifactId>Saxon-HE</artifactId>
  <version>9.5.1-4</version>
</dependency>

Build DSpace with mvn package.

Update your webapps with ant update_webapps (or fresh_install or whatever).

In [dspace]/webapps/xmlui/sitemap.xmap, change the XSLT transformer xslt-processor-role value to saxon. Note: this can be done as part of the build process, but that's not how my workflow is currently set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment