ZVON > Graphotron > Graphotron Reference
| >> graphotron << | daVinci | vcg | dot | tutorial | download | about |

Namespace http://zvon.org/graphotron
Element script
Description A script which can be used to set variable or param. If its value is "xslt" then a subset of XSLT can be used. This subset consists of xsl:template and its permitted descendats. It can use variables, parameters and keys specified in the Graphotron file.
Attributes type [ required ]
Type of the scripting language. ZvonGraphotron supports value "xslt".
Parents param, variable

XML Source

<source>
     <CCC/>
     <CCC>c2</CCC>
     <CCC>c3</CCC>
     <CCC/>
</source>
Graphotron Source

<graphotron version="1.0" xmlns="http://zvon.org/graphotron" >
     <variable name="marker">*</variable>
     <variable name="xxx">
          <gr:script type="xslt" xmlns = "" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:gr="http://zvon.org/graphotron" >
               <xsl:template match="/">
                    <xsl:apply-templates select="//CCC"/>
               </xsl:template>
               <xsl:template match="CCC">
                    <xsl:value-of select="$marker"/>
                    <xsl:value-of select="."/>
                    <xsl:text>-</xsl:text>
               </xsl:template>
          </gr:script>
     </variable>
     <vertex match="//*">
          <name select="$xxx"/>
     </vertex>
     <edge match="//*" select="*"/>
</graphotron>

Display
Graph screenshot