changeset 2168:a079f4e26001

visualize-transitions.xsl: Fixed output of conditions. flys-artifacts/trunk@3763 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 25 Jan 2012 10:52:58 +0000
parents e0add4b2d4bc
children b817e680cf18
files flys-artifacts/ChangeLog flys-artifacts/contrib/visualize-transitions.xsl
diffstat 2 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Jan 25 10:19:30 2012 +0000
+++ b/flys-artifacts/ChangeLog	Wed Jan 25 10:52:58 2012 +0000
@@ -1,3 +1,9 @@
+2012-01-25	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* contrib/visualize-transitions.xsl: Fixed output of the conditions 
+	  of the transitions. Now you can see the circumstances
+	  when a branch is taken.
+
 2012-01-25  Raimund Renkert <raimund.renkert@intevation.de>
 
 	Issue 461.
--- a/flys-artifacts/contrib/visualize-transitions.xsl	Wed Jan 25 10:19:30 2012 +0000
+++ b/flys-artifacts/contrib/visualize-transitions.xsl	Wed Jan 25 10:52:58 2012 +0000
@@ -92,9 +92,11 @@
 
     <xsl:template match="condition" mode="inside-artifact">
         <xsl:text> [ label="</xsl:text>
-        <xsl:value-of select="@inputvalue"/>
+        <xsl:value-of select="@data"/>
         <xsl:text> </xsl:text>
-        <xsl:value-of select="@operator"/>
+        <xsl:call-template name="readable-operator">
+            <xsl:with-param name="operator" select="@operator"/>
+        </xsl:call-template>
         <xsl:text> </xsl:text>
         <xsl:value-of select="@value"/>
         <xsl:text>" ]</xsl:text>
@@ -103,6 +105,15 @@
     <xsl:template match="text()" mode="inside-artifact"/>
     <xsl:template match="text()"/>
 
+    <xsl:template name="readable-operator">
+        <xsl:param name="operator" />
+        <xsl:choose>
+            <xsl:when test='$operator = "equal"'>=</xsl:when>
+            <xsl:when test='$operator = "notequal"'>!=</xsl:when>
+            <xsl:otherwise><xsl:value-of select="$operator"/></xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+
      <xsl:template name="string-replace-all">
         <xsl:param name="text" />
         <xsl:param name="replace" />

http://dive4elements.wald.intevation.org