14. Compiling XSL to SEF (3/3)

Whether you use Java or Node.js to compile, there’s some setup you need to do. For Java, you have to get the classpath and other aspects of the runtime environment setup. For Node.js, you have to install and configure node.

We’ve added Gradle build targets that will take care of this setup for you. Pro: all the setup will be done for you. Con: using the build tasks may be different from how you’ll do it elsewhere.

The targets are eej for Saxon-EE and either node_xslt3 or docker_xslt3 for Node.js, depending on whether you’re using Node.js natively or via Docker. To compile “style.xsl” run:

./gradlew -Pxsl=style.xsl eej

The -Pxsl= passes an option to Gradle that the eej step uses. The default export file has the same name as your stylesheet, but with the extension .sef.json. You can override that with -Pexport=, if you wish.

The Node.js version works the same way, just use node_xslt3 or docker_xslt3 instead of eej.