home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the 3D Game Programming Gurus / gurus.iso / DirectX / dx9sdkcp.exe / SDK (C++) / Samples / SampleBrowser / samples.xslt < prev   
Encoding:
Extensible Markup Language  |  2002-11-12  |  6.3 KB  |  148 lines

  1. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  2.     <xsl:template match="/">
  3.     <table width="97%" border="0" cellpadding="0" cellspacing="0">
  4.         <xsl:for-each select="//sample" order-by="name">
  5.             <tr>
  6.             <td valign="top" width="100%">
  7.                 <a>
  8.  
  9.                 <xsl:attribute name="class">
  10.                 <xsl:choose>
  11.                     <xsl:when test="@installed[.='no']">name_notinstalled</xsl:when>
  12.                     <xsl:otherwise>name_installed</xsl:otherwise>
  13.                 </xsl:choose>
  14.                 </xsl:attribute>
  15.  
  16.                 <xsl:if test="exe[.!='']">
  17.                     <xsl:attribute name="href">..\..\"<xsl:value-of    select="exefolder"/><xsl:value-of select="exe"/>"</xsl:attribute>
  18.                     <xsl:attribute name="title">..\..\<xsl:value-of    select="exefolder"/><xsl:value-of select="exe"/></xsl:attribute>
  19.                 </xsl:if>
  20.  
  21.                 <xsl:value-of select="name"/>
  22.  
  23.                 </a>
  24.  
  25.                 <img class="language" hspace="5" width="19" height="19">
  26.                 <xsl:choose>
  27.                     <xsl:when test="language[.='Executable-Only']"><xsl:attribute name="src">img/spacer.gif</xsl:attribute></xsl:when>
  28.                     <xsl:when test="language[.='C++']"><xsl:attribute name="src">img/lang_cpp.gif</xsl:attribute></xsl:when>
  29.                     <xsl:when test="language[.='C#']"><xsl:attribute name="src">img/lang_cs.gif</xsl:attribute></xsl:when>
  30.                     <xsl:when test="language[.='VB.Net']"><xsl:attribute name="src">img/lang_vb.gif</xsl:attribute></xsl:when>
  31.                 </xsl:choose>
  32.                 </img>
  33.             </td>
  34.             <td valign="top" align="right">
  35.                 <table cellpadding="0" cellspacing="0" border="0">
  36.                 <tr>
  37.                     <td>
  38.                     <xsl:if test="complexity[. > 0]">
  39.                         <img class="difficulty" width="90" height="19" hspace="10">
  40.                         <xsl:choose>
  41.                             <xsl:when test="complexity[. > 1999]"><xsl:attribute name="src">img/diff_advanced.gif</xsl:attribute></xsl:when>
  42.                             <xsl:when test="complexity[. > 999]"><xsl:attribute name="src">img/diff_intermediate.gif</xsl:attribute></xsl:when>
  43.                             <xsl:otherwise><xsl:attribute name="src">img/diff_beginner.gif</xsl:attribute></xsl:otherwise>
  44.                         </xsl:choose>
  45.                         </img>
  46.                     </xsl:if>
  47.                     </td>
  48.                     <td>
  49.                     <img class="difficulty" width="90" height="19">
  50.                         <xsl:choose>
  51.                             <xsl:when test="type[.='sample']"><xsl:attribute name="src">img/type_sample.gif</xsl:attribute></xsl:when>
  52.                             <xsl:when test="type[.='tutorial']"><xsl:attribute name="src">img/type_tutorial.gif</xsl:attribute></xsl:when>
  53.                             <xsl:when test="type[.='demo']"><xsl:attribute name="src">img/type_demo.gif</xsl:attribute></xsl:when>
  54.                             <xsl:when test="type[.='utility']"><xsl:attribute name="src">img/type_utility.gif</xsl:attribute></xsl:when>
  55.                         </xsl:choose>
  56.                     </img>
  57.                     </td>
  58.                 </tr>
  59.                 </table>
  60.             </td>
  61.             <td rowspan="4" valign="top" align="right">
  62.                 <xsl:attribute name="class">
  63.                 <xsl:choose>
  64.                     <xsl:when test="screenshot[.!='']">Screenshot</xsl:when>
  65.                     <xsl:otherwise>noScreenshot</xsl:otherwise>
  66.                 </xsl:choose>
  67.                 </xsl:attribute>
  68.  
  69.                 <img hspace="10" width="78" height="12" style="position: relative; top: -12px; left: -10px;">
  70.                 <xsl:choose>
  71.                     <xsl:when test="@installed[.='no']"><xsl:attribute name="src">img\results_not_installed.gif</xsl:attribute></xsl:when>
  72.                     <xsl:otherwise><xsl:attribute name="src">img\spacer.gif</xsl:attribute></xsl:otherwise>
  73.                 </xsl:choose>
  74.                 </img>
  75.  
  76.                 <a>
  77.                 <xsl:if test="exe[.!='']">
  78.                 <xsl:attribute name="href">..\..\"<xsl:value-of select="exefolder"/><xsl:value-of select="exe"/>"</xsl:attribute>
  79.                 <xsl:attribute name="title">..\..\<xsl:value-of select="exefolder"/><xsl:value-of select="exe"/></xsl:attribute>
  80.                 </xsl:if>
  81.  
  82.                 <xsl:if test="screenshot[.!='']">
  83.                 <img width="90" border="0" onError="style.display = 'None'" style="position: relative; top: -5px">
  84.                     <xsl:attribute name="src">
  85.                     ..\..\<xsl:value-of select="folder"/><xsl:value-of select="screenshot"/>
  86.                     </xsl:attribute>
  87.                 </img>
  88.                 </xsl:if>
  89.                 </a>
  90.             </td>
  91.             </tr>
  92.             <tr>
  93.             <td colspan="2" valign="top"><p class="description_highlight"></p></td>
  94.             </tr>
  95.             <tr>
  96.             <td colspan="2" valign="top"><p class="description"><xsl:value-of select="description"/></p><p></p></td>
  97.             </tr>
  98.             <tr>
  99.             <td colspan="2" valign="top" height="30" style="padding-left: 22px">
  100.                 <xsl:if test="exe[.!='']">
  101.                 <a class="links">
  102.                 <xsl:attribute name="href">..\..\"<xsl:value-of select="exefolder"/><xsl:value-of select="exe"/>"</xsl:attribute>
  103.                 <xsl:attribute name="title">..\..\<xsl:value-of select="exefolder"/><xsl:value-of select="exe"/></xsl:attribute>Executable<font style="text-decoration: none"> </font></a>
  104.                 </xsl:if>
  105.  
  106.                 <xsl:if test="doc[.!='']">
  107.                 <a class="links">
  108.                     <xsl:choose>
  109.                     <xsl:when test="language[.='Executable-Only']">
  110.                         <xsl:attribute name="href"><xsl:value-of select="doc"/></xsl:attribute>
  111.                         <xsl:attribute name="title"><xsl:value-of select="doc"/></xsl:attribute>
  112.                     </xsl:when>
  113.  
  114.                     <xsl:when test="language[.='C++']">
  115.                         <xsl:attribute name="href">ms-its:../../Doc/DirectX9/directx9_c.chm<xsl:value-of select="doc"/></xsl:attribute>
  116.                         <xsl:attribute name="title">../../Doc/DirectX9/directx9_c.chm<xsl:value-of select="doc"/></xsl:attribute>
  117.                     </xsl:when>
  118.  
  119.                     <xsl:otherwise>
  120.                         <xsl:attribute name="href">..\..\"<xsl:value-of select="folder"/><xsl:value-of select="doc"/>"</xsl:attribute>
  121.                         <xsl:attribute name="title">..\..\<xsl:value-of select="folder"/><xsl:value-of select="doc"/></xsl:attribute>
  122.                     </xsl:otherwise>
  123.                     </xsl:choose>
  124.                     Documentation<font style="text-decoration: none"> </font></a>
  125.                 </xsl:if>
  126.  
  127.                 <xsl:choose>
  128.                 <xsl:when test="projectfile6[.!='']">
  129.                     <a class="links">
  130.                     <xsl:attribute name="href">..\..\"<xsl:value-of select="folder"/><xsl:value-of select="projectfile6"/>
  131.                     <xsl:if test="projectfile7[.!='']">*<xsl:value-of select="folder"/><xsl:value-of select="projectfile7"/></xsl:if>"
  132.                     </xsl:attribute>Project Files<font style="text-decoration: none"> </font></a>
  133.                 </xsl:when>
  134.                 <xsl:otherwise>
  135.                     <xsl:if test="projectfile7[.!='']">
  136.                         <a class="links">
  137.                         <xsl:attribute name="href">..\..\"<xsl:value-of select="folder"/><xsl:value-of select="projectfile7"/>"
  138.                         </xsl:attribute>Project Files<font style="text-decoration: none"> </font></a>
  139.                     </xsl:if>
  140.                 </xsl:otherwise>
  141.                 </xsl:choose>
  142.             </td>
  143.             </tr>
  144.         </xsl:for-each>
  145.     </table>
  146.     </xsl:template>
  147. </xsl:stylesheet>
  148.