vgritsenko    2003/07/30 20:51:18

  Modified:    src/webapp/stylesheets/system status2html.xslt
  Log:
  Use generate-id() instead of name. Name has duplicates.
  
  Revision  Changes    Path
  1.6       +28 -27    cocoon-2.1/src/webapp/stylesheets/system/status2html.xslt
  
  Index: status2html.xslt
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/webapp/stylesheets/system/status2html.xslt,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- status2html.xslt  28 Apr 2003 08:38:32 -0000      1.5
  +++ status2html.xslt  31 Jul 2003 03:51:18 -0000      1.6
  @@ -1,12 +1,14 @@
   <?xml version="1.0"?>
   
  -<!-- 
  -  CVS $Id$
  --->
  +<!--+
  +    | Converts output of the StatusGenerator into HTML page
  +    | 
  +    | CVS $Id$
  +    +-->
   
   <xsl:stylesheet version="1.0"
  - xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  - xmlns:status="http://apache.org/cocoon/status/2.0";>
  +                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  +                xmlns:status="http://apache.org/cocoon/status/2.0";>
    
     <xsl:param name="contextPath" select="string('/cocoon')"/>
   
  @@ -20,7 +22,7 @@
   
         <body>
           <h1><xsl:value-of select="@status:host"/> - <xsl:value-of 
select="@status:date"/></h1>
  -        <xsl:apply-templates/>    
  +        <xsl:apply-templates/>
         </body>
       </html>
     </xsl:template>
  @@ -33,7 +35,7 @@
   
     <xsl:template match="status:value">
       <li>
  -      <span class="description"><xsl:value-of select="@status:name"/><xsl:text>: 
</xsl:text></span>    
  +      <span class="description"><xsl:value-of select="@status:name"/><xsl:text>: 
</xsl:text></span>
         <xsl:choose>
           <xsl:when test="contains(@status:name,'free') or 
contains(@status:name,'total')">
             <xsl:call-template name="suffix">
  @@ -44,8 +46,8 @@
             <xsl:value-of select="status:line"/>
           </xsl:when>
           <xsl:otherwise>
  -          <span class="switch" id="[EMAIL PROTECTED]:name}-switch" 
onclick="toggle('[EMAIL PROTECTED]:name}')">[show]</span>
  -          <ul id="[EMAIL PROTECTED]:name}" style="display: none">
  +          <span class="switch" id="{generate-id(.)}-switch" 
onclick="toggle('{generate-id(.)}')">[show]</span>
  +          <ul id="{generate-id(.)}" style="display: none">
                <xsl:apply-templates />
             </ul>
           </xsl:otherwise>
  @@ -57,23 +59,22 @@
       <li><xsl:value-of select="."/></li>
     </xsl:template>
   
  -     <xsl:template name="suffix">
  -             <xsl:param name="bytes"/>
  -             <xsl:choose>
  -                     <!-- More than 4 MB (=4194304) -->
  -                     <xsl:when test="$bytes &gt;= 4194304">
  -                             <xsl:value-of select="round($bytes div 10485.76) div 
100"/> MB
  -                     </xsl:when>
  -                     <!-- More than 4 KB (=4096) -->
  -                     <xsl:when test="$bytes &gt; 4096">
  -                             <xsl:value-of select="round($bytes div 10.24) div 
100"/> KB
  -                     </xsl:when>
  -                     <!-- Less -->
  -                     <xsl:otherwise>
  -                             <xsl:value-of select="$bytes"/> B
  -                     </xsl:otherwise>
  -             </xsl:choose>
  -     </xsl:template>
  +  <xsl:template name="suffix">
  +    <xsl:param name="bytes"/>
  +    <xsl:choose>
  +      <!-- More than 4 MB (=4194304) -->
  +      <xsl:when test="$bytes &gt;= 4194304">
  +        <xsl:value-of select="round($bytes div 10485.76) div 100"/> MB
  +      </xsl:when>
  +      <!-- More than 4 KB (=4096) -->
  +      <xsl:when test="$bytes &gt; 4096">
  +        <xsl:value-of select="round($bytes div 10.24) div 100"/> KB
  +      </xsl:when>
  +      <!-- Less -->
  +      <xsl:otherwise>
  +        <xsl:value-of select="$bytes"/> B
  +      </xsl:otherwise>
  +    </xsl:choose>
  +  </xsl:template>
     
   </xsl:stylesheet>
  -
  
  
  

Reply via email to