Getting Started

Learn how to use transpect


There are no further prerequisites as are required to run XProc. If you are not familiar with XProc, we suggest to work yourself through Roger L. Costello’s ➼ XProc tutorial first.

XML Calabash

We recommend to use our pre-configured XML Calabash for running transpect’s XProc pipelines. It includes convenient frontend scripts and extensions steps which are essential to some modules.


XML Calabash needs at least Java 1.7 to run. We noticed some odd behaviour while running XML Calabash with a JVMs other than Oracle. If you get memory issues, consider to install the 64-bit version.

Project Setup

Install XML Calabash

We recommend to use Git or SVN to checkout Calabash to take care that all dependencies are met. The calabash directory should be placed at the top-level of your project directory.

  |  |
  |  |--calabash.bat
git clone --recursive calabash
Optional: checkout XML Calabash with SVN

The SVN client of GitHub doesn't support SVN externals, so we have to get each module separately.

svn co calabash
svn co calabash/distro

Some transpect modules depend on certain XML Calabash extensions, so you may want to get them, too.

svn co calabash/extensions/transpect/unzip-extension
svn co calabash/extensions/transpect/rng-extension
svn co calabash/extensions/transpect/image-props-extension
svn co calabash/extensions/transpect/image-transform-extension

Checkout the transpect modules

First, we have to checkout the modules with Git or SVN. For example, we want to get docx2hub:convert, which converts Microsoft Word to ➼ Hub XML. The docx2hub module depends on xproc-util and xslt-util.

git clone
git clone
git clone
git clone
Optional: checkout modules with SVN
svn co docx2hub
svn co htmlreports          
svn co xslt-util
svn co xproc-util

After we cloned XML Calabash and the transpect modules, our project directory should look like this.


Create an XML Catalog

Transpect uses canonical import URIs to import other modules. To resolve this URIs, our XML Calabash looks after an XML catalog in the project directory. Starting from the project dir, the path is usually xmlcatalog/catalog.xml. So you have to create the directory xmlcatalog and create a file named catalog.xml in this directory.

  |  |--catalog.xml

The XML catalog of the project is used to include the catalogs of the transpect modules. Therefore the nextCatalog element is used to connect the module catalogs. Edit the catalog.xml and add the following lines.

<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
  <nextCatalog catalog="../docx2hub/xmlcatalog/catalog.xml"/>
  <nextCatalog catalog="../htmlreports/xmlcatalog/catalog.xml"/>
  <nextCatalog catalog="../xproc-util/xmlcatalog/catalog.xml"/>
  <nextCatalog catalog="../xslt-util/xmlcatalog/catalog.xml"/>

Run the pipeline

Command line

After we are included transpect in our project, we can run the docx2hub:convert pipeline to convert a Microsoft Word DOCX file to ➼ Hub XML. Users of Linux, Mac OS X or Cygwin can use a convenient Bash script:

./calabash/ -o result=MyXMLfile.xml docx2hub/xpl/docx2hub.xpl docx=MyWordfile.docx

There exists also a Batch file for Windows users:

.\calabash\calabash.bat -o result=MyXMLfile.xml .\docx2hub\xpl\docx2hub.xpl docx=MyWordfile.docx

Include in your pipeline

You can import and use transpect modules in your own XProc pipelines. Therefore, you need to declare the namespace and add the p:import statement of the XProc step you want to use. Here is a simple XProc pipeline which implements docx2hub:convert.

<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="" 
  <p:output port="result"/>
  <p:option name="docx"/>
  <p:import href=""/>
  <docx2hub:convert name="docx2hub">
    <p:with-option name="docx" select="$docx"/>

Learn more?

If you want to get a deeper insight into the transpect framework, we would recommend to read our Tutorials.