The Dot Markup Language

What is DotML?

DotML is a XML based syntax for the input language of the 'Dot' graph drawing tool from the AT&T GraphViz suite. It can be transformed to the native syntax of the 'Dot' tool using XSLT. DotML graphs can be embedded into XHTML documents and there are scripts that automatically render the graphs into SVG charts and embed them in the html page. This whole website is an example of how html with embedded svg was generated from (generated) XHTML documents that contained DotML elements.

DotML is the big brother of S-Dot, which is an s-expressions based 'Dot' syntax that comes with a translator written in Common Lisp.

Sponsored links:

Example 1/1:
Source code:
<graph file-name="graphs/nice_graph" rankdir="LR">
<node id="a" label="node1" fontsize="9" fontname="Arial"/>
<node id="b" label="node2" fontsize="9" fontname="Arial"/>
<node id="c" label="node3" fontsize="9" fontname="Arial"/>
<node id="d" label="node4" fontsize="9" fontname="Arial"/>
<edge from="a" to="b" fontname="Arial" fontsize="9" label="edge1"/>
<edge from="a" to="c" fontname="Arial" fontsize="9" label="edge2"/>
<edge from="b" to="c" fontname="Arial" fontsize="9" label="edge3"/>
<edge from="b" to="d" fontname="Arial" fontsize="9" label="edge4"/>
<edge from="c" to="d" fontname="Arial" fontsize="9" label="edge5"/>
When do I need it?

You don't need DotML when you only want to create a single chart with the 'Dot' tool. It is easier then to type the graph in the native 'Dot' language or to use one of these tools.

You need DotML when you want to generate SVG with 'Dot' automatically from XML input data. The only thing you have to do is transforming your data into a DotML document (for example by using XSLT). The DotML script then generates the SVG charts and embeds them into a HTML page.

How do I use it?

Getting graphs from your data is a three-step process. First, generate or manually type a XHTML (or any other XML) file that contains DotML elements.

Use "" as the namespace identifier for DotML elements. If you want to validate your DotML elements, use the DotML Schema.

Second, apply the script "generate-svg-graphics.bash" on the input file. It applies the dotml2dot.xsl stylesheet and generates a SVG chart and a CSS file containing the size of the SVG chart for each DotML graph element. Please have a look into "generate-svg-graphics.bash" for required environment variables and parameters.

Third, if the DotML graph is embedded into an XHTML document, the XSLT stylesheet "embed-svg-graphics.xsl" replaces the DotML graph elements by the inclusion of the generated SVGs. Please look into "embed-svg-graphics.xsl" for details.

Where do I get it?

The DotML 1.4 package including the XML Schema file, the XSLT stylesheet, the scripts, and examples can be downloaded here. Make sure you have read the licence.

Is it free?

Yes it is. You can do whatever you want with it as long as you mention that you use it. See the licence for details.

Can I make donations?

Yes. If you find this stuff helpful, please consider a donation:

Alternatively, there are also sponsored links on this page.

Sponsored links

 Copyright 2002-2010 by Martin Loetzsch (, all rights reserved. See the DotML licence for details.