ZVON > Graphotron > Graphotron

Miloslav Nic [nicmila@systinet.com]

Graphotron

Welcome to the official site of Graphotron, a simple XML language for drawing graphs with XPath. Graphotron is described in About document and you can experiment with the language using ZvonGraphotron, which outputs formats readable by several graphical packages (Graphviz, daVinci, VCG, ...). There is also a tutorial and the official reference.

XML Source
  
<source>
<title 
  Zvon="http://www.zvon.org/ZvonSW/ZvonGraphotron">
  Graphotron
</title>

<color>purple</color>
<color>green</color>
<color>maroon</color>
</source>
              

Graphotron Source
<graphotron version="1.0" 
  xmlns="http://zvon.org/graphotron" 
  xmlns:dot="http://zvon.org/graphotron/dot">

<global-settings>
<dot:label select="/*/title/@Zvon"/>
</global-settings>

<vertex match="/*/*">
<name select="substring(/*/title,
                 count(preceding::*)*3 - 1,
                 3)"/>
<dot:color select="."/>
<dot:fontcolor select="."/>
</vertex>

<vertex match="/*/title/@*">
<name select="name()"/>
<dot:color>blue</dot:color>
<dot:fontcolor>blue</dot:fontcolor>
<dot:fontsize>30</dot:fontsize>
<dot:shape>diamond</dot:shape>
</vertex>


<vertex match="//title">
<name>G</name>
<dot:color>red</dot:color>
<dot:fontcolor>red</dot:fontcolor>
<dot:fontsize>40</dot:fontsize>
<dot:shape>doublecircle</dot:shape>
</vertex>

<edge match="//title" select="following::*">
<dot:color select-from-target="."/>
</edge>

<edge match="//color" select="//@*">
<dot:color select="."/>
</edge>

</graphotron>