Name

cx:ditaa — Draws diagrams with ditaa.

Synopsis

The cx:ditaa step constructs diagrams with ditaa (DIagrams Through Ascii Art).

Input portPrimarySequenceContent types
source✔  text 
Output portPrimarySequenceContent types
result✔   
Option nameTypeDefault value
content-typexs:string?'image/png'
parametersmap(xs:QName, item()*)?()
This is an extension step; to use it, your pipeline must include its declaration. For example, by including the extension library with an import at the top of your pipeline:
<p:import href="https://xmlcalabash.com/ext/library/diagramming.xpl"/>
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
  |   <p:input port="source" content-types="text"/>
  |   <p:output port="result"/>
  |   <p:option name="content-type" as="xs:string?" select="'image/png'"/>
5 |   <p:option name="parameters" as="map(xs:QName, item()*)?"/>
  |</p:declare-step>

Description

The supported content types are the content types supported by the javax.imageio.ImageWriter class. At the time of this writing: image/png (or image/x-png), image/gif, image/jpeg, image/tiff, and image/bmp (or image/vnd.wap.wbmp)

XML Calabash is built with ditaa version 0.9.

Example

The ditaa user guide includes the example shown in Example 1, “Example ditaa source”. It renders to the image show in Figure 1, “Example ditaa”.

+--------+   +-------+    +-------+
|        | --+ ditaa +--> |       |
|  Text  |   +-------+    |diagram|
|Document|   |!magic!|    |       |
|     {d}|   |       |    |       |
+---+----+   +-------+    +-------+
    :                         ^
    |       Lots of work      |
    +-------------------------+
Example 1Example ditaa source
Figure 1Example ditaa

Dependencies

This step is included in the XML Calabash application. If you are getting XML Calabash from Maven, you will also need to include the extension dependency:

  • com.xmlcalabash:diagramming:3.0.0-alpha24

The following third-party dependencies will also be included transitively:

  • net.sourceforge.plantuml:plantuml:1.2025.0
  • de.rototor.jeuclid:jeuclid-core:3.1.14
  • ditaa0.9.jar, included in the XML Calabash extension because it’s not available through Maven.