An extension step for XML Calabash to run JavaScript and NodeJS in XProc
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
io/transpect/calabash/extensions update class file Mar 20, 2018
lib update rhino and trireme Mar 20, 2018
test add test file for json2xml Feb 10, 2017
xmlcatalog update catalog Mar 20, 2018
LICENSE Initial commit Feb 10, 2017 update readme Feb 10, 2017
javascript-declaration.xpl add XProc example and declaration Feb 10, 2017


An extension step for XML Calabash to run JavaScript and NodeJS in XProc


This step runs JavaScript code either by reading it from the input port or from a reference to an external file.

  <p:with-option name="href" select="'test.js'"/>
      print('hello world')

The step implements the JavaScript engines Rhino from Mozilla and Nashorn from Oracle and the trireme library from Apigee for running node.js scripts inside the JVM.


  • Java 1.8

XML Calabash Configuration

  • add the path to and the jar files in the lib directory to your Java classpath
  • edit your XProc config and add the class file
<xproc-config xmlns="" 

  <implementation type="tr:javascript" class-name="JavaScriptExtension"/>


NodeJS code is just executed with Trireme and Rhino. Trireme doesn't support the newer JavaScript engine Nashorn. Please also note that there are differences between the JavaScript implementation of Rhino and NodeJS. There is a detailed list of supported features from Mozilla.