Name
cx:ditaa — Draws diagrams with ditaa.
Synopsis
The cx:ditaa
step constructs diagrams with
ditaa
(DIagrams Through Ascii Art).
Input port | Primary | Sequence | Content types |
---|---|---|---|
source | ✔ | text |
Output port | Primary | Sequence | Content types |
---|---|---|---|
result | ✔ |
Option name | Type | Default value |
---|---|---|
content-type | xs:string? | 'image/png' |
parameters | map(xs:QName, item()*)? | () |
<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 | +-------------------------+

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.