home *** CD-ROM | disk | FTP | other *** search
/ PC World 2003 December / PCWorld_2003-12_cd.bin / Software / komercni / alc / ep2sr51csy.msi / Ep.CAB / report.xsl < prev    next >
Extensible Markup Language  |  2002-02-25  |  4KB  |  136 lines

  1. <?xml version='1.0' encoding="windows-1250" ?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  3.  
  4. <xsl:template match="/">
  5.     <xsl:for-each select="report">
  6.         <h1><xsl:value-of select="title"/></h1>
  7.         <table width="100%">
  8.             <tr>
  9.                 <td>Datum: <xsl:value-of select="date"/></td>
  10.                 <td>U₧ivatel: <xsl:value-of select="user"/></td>
  11.             </tr>
  12.         </table>
  13.         <br/>
  14.         <table><tbody><tr><td>
  15.         <xsl:for-each select="group">
  16.             <xsl:if test="title">
  17.                 <table width="100%" cellspacing="0" cellpadding="0"><tbody><tr>
  18.                     <td style="cursor:hand" onclick="ToggleGroup(this)">
  19.                     <img id="toggle"/>
  20.                     </td>
  21.                     <td> </td>
  22.                     <td width="100%">
  23.                     <xsl:for-each select="title">
  24.                         <b><xsl:value-of select="label"/>:</b> <xsl:value-of select="value"/><br/>
  25.                     </xsl:for-each>
  26.                     </td>
  27.                 </tr></tbody></table>
  28.             </xsl:if>
  29.  
  30.             <table class="Frame" cellspacing="0" width="100%">
  31.                 <xsl:apply-templates select="head/row"/>
  32.                 <xsl:apply-templates select="body/row" order-by="x"/><!-- order-by="column[0]/item" -->
  33.                 <xsl:apply-templates select="tail/row"/>
  34.                 <xsl:if test="count">
  35.                     <tr>
  36.                         <td class="foot">
  37.                         <xsl:attribute name="colspan"><xsl:eval>GetColumnCount(this)</xsl:eval></xsl:attribute>
  38.                         <b>poΦet:</b> <xsl:value-of select="count"/>
  39.                         </td>
  40.                     </tr>
  41.                 </xsl:if>
  42.             </table>
  43.             <br/>
  44.         </xsl:for-each>
  45.         </td></tr></tbody></table>
  46.     </xsl:for-each>
  47. </xsl:template>
  48.  
  49. <xsl:template match="row">
  50.     <tr>
  51.     <xsl:apply-templates select="column"/>
  52.     </tr>
  53. </xsl:template>
  54.  
  55. <xsl:template match="column">
  56.     <td class="Frame">
  57.     <xsl:eval>g_itemcnt=0,""</xsl:eval>
  58.     <xsl:for-each select="item" order-by="item">
  59.         <xsl:if expr="g_itemcnt>0">
  60.             <br/>
  61.         </xsl:if>
  62.         <xsl:apply-templates select="."/>
  63.         <xsl:if test=".[.='']"> </xsl:if>
  64.         <xsl:eval>g_itemcnt++,""</xsl:eval>
  65.     </xsl:for-each>
  66.     <xsl:if expr="g_itemcnt==0"> </xsl:if>
  67.     </td>
  68. </xsl:template>
  69.  
  70. <xsl:template match="head/row/column">
  71.     <td class="head" align="center" style="cursor:hand"
  72.      onmouseover="window.status='Klikn∞te - se°azenφ'" onmouseout="window.status=''">
  73.     <xsl:attribute name="onclick">javascript:sort(<xsl:eval>formatNumber(childNumber(this)-1,"0")</xsl:eval>)</xsl:attribute>
  74.     <div style="color:black"><b>
  75.     <xsl:apply-templates select="item"/>
  76.     </b></div>
  77.     </td>
  78. </xsl:template>
  79.  
  80. <xsl:template match="tail/row/column">
  81.     <td class="foot">
  82.     <xsl:eval>g_itemcnt=0,""</xsl:eval>
  83.     <xsl:for-each select="item|sum|min|max|avg|count">
  84.         <xsl:if expr="g_itemcnt>0">
  85.             <br/>
  86.         </xsl:if>
  87.         <xsl:apply-templates select="."/>
  88.         <xsl:eval>g_itemcnt++,""</xsl:eval>
  89.     </xsl:for-each>
  90.     <xsl:if expr="g_itemcnt==0">
  91.          
  92.     </xsl:if>
  93.     </td>
  94. </xsl:template>
  95.  
  96. <xsl:template match="item">
  97.     <xsl:apply-templates select="text()"/>
  98. </xsl:template>
  99.  
  100. <xsl:template match="sum">
  101.     souΦet: <xsl:apply-templates select="text()"/>
  102. </xsl:template>
  103.  
  104. <xsl:template match="avg">
  105.     pr∙m∞r: <xsl:apply-templates select="text()"/>
  106. </xsl:template>
  107.  
  108. <xsl:template match="min">
  109.     min: <xsl:apply-templates select="text()"/>
  110. </xsl:template>
  111.  
  112. <xsl:template match="max">
  113.     max: <xsl:apply-templates select="text()"/>
  114. </xsl:template>
  115.  
  116. <xsl:template match="count">
  117.     poΦet: <xsl:apply-templates select="text()"/>
  118. </xsl:template>
  119.  
  120. <xsl:template match="text()">
  121.     <xsl:value-of select="."/>
  122. </xsl:template>
  123.  
  124.  
  125. <xsl:script><![CDATA[
  126.  
  127. var g_itemcnt;
  128.  
  129. function GetColumnCount(eGroup) {
  130.     nlist=eGroup.selectNodes("head/row/column");
  131.     return formatNumber(nlist.length,"0");
  132. }
  133.  
  134. ]]></xsl:script>
  135.  
  136. </xsl:stylesheet>