Author: jbeard
Date: Thu Mar 17 16:20:44 2011
New Revision: 1082571
URL: http://svn.apache.org/viewvc?rev=1082571&view=rev
Log:
Added ability to accept parameters to make chart less verbose.
Modified:
commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/util/scxml-to-dot.xsl
Modified:
commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/util/scxml-to-dot.xsl
URL:
http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/util/scxml-to-dot.xsl?rev=1082571&r1=1082570&r2=1082571&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/util/scxml-to-dot.xsl
(original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/util/scxml-to-dot.xsl Thu
Mar 17 16:20:44 2011
@@ -30,15 +30,31 @@ a document in the graphviz dot syntax.
<output method="text"/>
<param name="maxDepth" select="9999"/>
+ <param name="printScript" select="false()"/>
+ <param name="printCondition" select="false()"/>
<template name="htmlTransitionLabel">
<param name="transitions"/>
<param name="heading"/>
+ <variable name="colspan">
+ <choose>
+ <when test="$printScript and $printCondition">
+ <text>3</text>
+ </when>
+ <when test="$printScript or $printCondition">
+ <text>2</text>
+ </when>
+ <otherwise>
+ <text>1</text>
+ </otherwise>
+ </choose>
+ </variable>
+
<text>label=<<TABLE></text>
<if test="$heading">
<text><TR></text>
- <text><TD colspan="3"></text>
+ <text><TD colspan="</text><value-of
select="$colspan"/><text>"></text>
<value-of select="$heading"/>
<text></TD></text>
<text></TR></text>
@@ -48,14 +64,18 @@ a document in the graphviz dot syntax.
<text><TD></text>
<value-of select="@event"/>
<text></TD></text>
- <text><TD></text>
- <call-template name="attribute-value">
- <with-param name="text" select="@cond"/>
- </call-template>
- <text></TD></text>
- <text><TD></text>
- <value-of select="s:script/text()"/>
- <text></TD></text>
+ <if test="$printCondition">
+ <text><TD></text>
+ <call-template name="attribute-value">
+ <with-param name="text"
select="@cond"/>
+ </call-template>
+ <text></TD></text>
+ </if>
+ <if test="$printScript">
+ <text><TD></text>
+ <value-of select="s:script/text()"/>
+ <text></TD></text>
+ </if>
<text></TR></text>
</for-each>
<text></TABLE>></text>
@@ -218,12 +238,12 @@ a document in the graphviz dot syntax.
<if test="$firstTransition/@event |
$firstTransition/s:script | $firstTransition/@cond">
<text>label="</text>
<value-of
select="$firstTransition/@event"/>
- <if
test="$firstTransition/@cond">
+ <if test="$printCondition and
$firstTransition/@cond">
<text>[</text>
<value-of
select="$firstTransition/@cond"/>
<text>]</text>
</if>
- <if
test="$firstTransition/s:script">
+ <if test="$printScript and
$firstTransition/s:script">
<text>/</text>
<call-template
name="replace-string">
<with-param
name="text" select="$firstTransition/s:script"/>