svn commit: r628770 - /lenya/trunk/src/modules-core/monitoring/xslt/log2svg.xsl

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Mon Feb 18 06:55:34 2008
New Revision: 628770

URL: http://svn.apache.org/viewvc?rev=628770&view=rev
Log:
Show info message if session log is empty instead of throwing SVG exception.

Modified:
    lenya/trunk/src/modules-core/monitoring/xslt/log2svg.xsl

Modified: lenya/trunk/src/modules-core/monitoring/xslt/log2svg.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/monitoring/xslt/log2svg.xsl?rev=628770&r1=628769&r2=628770&view=diff
==============================================================================
--- lenya/trunk/src/modules-core/monitoring/xslt/log2svg.xsl (original)
+++ lenya/trunk/src/modules-core/monitoring/xslt/log2svg.xsl Mon Feb 18 06:55:34 2008
@@ -34,9 +34,18 @@
   <xsl:template match="/mon:log">
     <svg:svg width="{$marginLeft + $width + 2 * $margin}" height="{$height + 2 * $margin}">
       <svg:text x="{$margin + $marginLeft + $width div 2}" y="{$margin - 5}" style="font-weight: bold;" text-anchor="middle"><xsl:value-of select="$title"/></svg:text>
-      <xsl:call-template name="yLine"/>
-      <xsl:call-template name="hourLine"/>
-      <xsl:apply-templates select="mon:entry"/>
+      <xsl:choose>
+        <xsl:when test="mon:entry">
+          <xsl:call-template name="yLine"/>
+          <xsl:call-template name="hourLine"/>
+          <xsl:apply-templates select="mon:entry"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <svg:text x="{$margin + $marginLeft + $width div 2}" y="{$margin + 10}" text-anchor="middle">
+            The session log is empty.
+          </svg:text>
+        </xsl:otherwise>
+      </xsl:choose>
     </svg:svg>
   </xsl:template>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.