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 the ditaa library that ships as part of 1.2025.2.
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 additional dependency:
net.sourceforge.plantuml:plantuml:1.2025.2
(At the time of writing dita version 0.11.x is included in the PlantUML jar, but not available separately from Maven.)