home *** CD-ROM | disk | FTP | other *** search
/ 11 Top Anwendungen / CD_ROM_MAGAZIN.iso / MoneyMethod-Demo / Beispiel / source / XML / tabnav.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2000-05-29  |  5.2 KB  |  148 lines

  1. <!-- Written by Afonin Evgeny -->
  2. <!-- Table "navigation" controls template -->
  3.  
  4. <xsl:stylesheet
  5.   version="1.0"
  6.   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  7.   xmlns:xt="http://www.jclark.com/xt">
  8. <xsl:output method="html"/>
  9. <!--<xsl:strip-space elements='*'/>-->
  10.  
  11. <xsl:template name="tabnavi">
  12. <xsl:param name="tabnum"/>
  13. <xsl:param name="count"/>
  14. <xsl:param name="splitcount"/>
  15. <!-- execution context - category -->
  16.  
  17. <!--        <p align="left"><a href="orderlist.htm">Proceed with order</a></p>
  18.         <p align="right" hspace="20">-->
  19. <table width="100%" cellspacing="0" cellpadding="0" border="0">
  20. <tr>
  21. <td width="70%">
  22.         <table cellspacing="0" cellpadding="0" border="0" width="100%">
  23.         <tr>
  24.         <td height="20">
  25.      <nobr>
  26.             <font face="arial" size="3" color="##382574">
  27.                 <p align="left">
  28.                     <xsl:value-of select="@name"/>
  29.                 </p>
  30.             </font>
  31.     </nobr> </td>
  32.         </tr>
  33.     <tr>
  34.     <td>
  35.           <table width="100%" height="1" bgcolor="#6865A8" cellspacing="0" cellpadding="0" border="0">
  36.           <tr><td><img src="{concat ($respath, 'Images/pixel.gif')}"/>
  37.           </td></tr></table>
  38.         </td>
  39.     </tr>
  40.         <tr>
  41.     <td height="20"><img src="{concat ($respath, 'Images/pixel.gif')}"/></td>
  42.     </tr>    
  43.         </table>
  44.     </td>
  45.     <td>
  46.  
  47.     <table cellpadding="0" cellspacing="0" border="0">
  48.     <tr>
  49.     <td>
  50.     <img src="{concat($respath,'Images/left.gif')}"/>
  51.     </td>
  52.     <td>
  53.         <a href="index.htm" target="_top"            
  54.            onmouseover="if (loaded) img_act('a2', 'main');  return true;"
  55.            onmouseout ="if (loaded) img_inact('a2'); return true;">
  56.          <img src="{concat($respath, 'Images/main.gif')}" name="a2" border="0" alt="Hauptmenu"/>
  57.         </a>
  58.     </td>
  59.     <td>
  60.         <a href="orderlist.htm"
  61.              onmouseover = "if (loaded) img_act('a3','best'); return true;"
  62.              onmouseout  = "if (loaded) img_inact('a3'); return true;">
  63.            <img src="{concat($respath, 'Images/buy.gif')}" name="a3" border="0" alt="Bestellen"/>
  64.         </a>
  65.         </td>
  66.  
  67.     <td>
  68.                         <!-- start of tables sequence -->
  69.         <xsl:choose>
  70.         <xsl:when test="$tabnum>1">
  71.                 <a href="{concat ('tcat', position(), number($tabnum)-1,'.htm')}"
  72.                  onmouseover = "if (loaded) img_act('a1','prev'); return true;"
  73.                  onmouseout  = "if (loaded) img_inact('a1'); return true;">
  74.                 <img src="{concat($respath, 'Images/prev.gif')}" border="0" alt="Vorher" name="a1"/>
  75.                 </a>
  76.         </xsl:when>
  77.                         <!-- link to previous category -->
  78.         <xsl:when test="preceding-sibling::category and $tabnum=1">
  79.                 <a href="{concat ('tcat', position()-1, ceiling( count(preceding-sibling::category[1]/row) div $splitcount), '.htm')}"
  80.                  onmouseover = "if (loaded) img_act('a1','prev'); return true;"
  81.                  onmouseout  = "if (loaded) img_inact('a1'); return true;">
  82.                 <img src="{concat($respath, 'Images/prev.gif')}" border="0" alt="Vorher" name="a1"/>
  83.                 </a>
  84.         </xsl:when>
  85.        <xsl:otherwise>
  86.                   <img src="{concat($respath, 'Images/prev.gif')}" border="0" alt="Vorher" name="a1"/>
  87.        </xsl:otherwise>
  88.       </xsl:choose>
  89.     </td>
  90.     <td>
  91.  
  92.                         <!-- link to next table in category -->
  93.         <xsl:choose>
  94.         <xsl:when test="count(ancestor-or-self::category/row)>=$count+$splitcount">
  95.                 <a href="{concat ('tcat', position(), number($tabnum)+1,'.htm')}"
  96.                  onmouseover = "if (loaded) img_act('a4','next'); return true;"
  97.                  onmouseout  = "if (loaded) img_inact('a4'); return true;">
  98.                 <img src="{concat($respath, 'Images/next.gif')}" border="0" alt="Weiter" name="a4"/>
  99.                 </a>
  100.         </xsl:when>
  101.                         <!-- link to next category -->
  102.         <xsl:when test="$count+$splitcount>count(ancestor-or-self::category/row) and following-sibling::category">
  103.                 <a href="{concat ('tcat', position()+1, '1.htm')}"
  104.                  onmouseover = "if (loaded) img_act('a4','next'); return true;"
  105.                  onmouseout  = "if (loaded) img_inact('a4'); return true;">
  106.                 <img src="{concat($respath, 'Images/next.gif')}" border="0" alt="Weiter" name="a4"/>
  107.                 </a>
  108.         </xsl:when>
  109.  
  110.         <xsl:otherwise>
  111.                 <img src="{concat($respath, 'Images/next.gif')}" border="0" alt="Weiter"/>
  112.         </xsl:otherwise>
  113.         </xsl:choose>
  114.     </td>
  115.     <td>
  116.     <img src="{concat($respath,'Images/right.gif')}"/>
  117.     </td>
  118.     </tr>
  119.     </table>
  120.  
  121.     </td>
  122.     <td width="20%">
  123.  
  124.     <table cellspacing="0" cellpadding="0" width="100%" border="0">
  125.     <tr>
  126.     <td><img src="{concat($respath,'Images/clean.gif')}" name="caption"/></td>
  127.     </tr>
  128.     <tr>
  129.     <td>        
  130.     <table width="100%" height="1" bgcolor="#6865A8" cellspacing="0" cellpadding="0" border="0">
  131.     <tr><td><img src="{concat ($respath, 'Images/pixel.gif')}"/></td></tr></table>
  132.     </td>
  133.     </tr>
  134.     <tr>
  135.     <td><img src="{concat($respath,'Images/clean.gif')}"/></td>
  136.     </tr>
  137. </table>
  138.  
  139. </td>
  140. </tr>
  141. </table>
  142. <p>
  143. <br/>
  144. </p>
  145. </xsl:template>
  146.  
  147. </xsl:stylesheet>
  148.