home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / DirectX / dxsdk_oct2004.exe / dxsdk.exe / Samples / SampleBrowser / samples.xslt < prev   
Encoding:
Extensible Markup Language  |  2004-09-27  |  9.4 KB  |  177 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="type; name">
  5.             <tr>
  6.             <td valign="top" width="100%">
  7.                 
  8.                 <xsl:attribute name="class">
  9.                 <xsl:choose>
  10.                     <xsl:when test="@installed[.='no']">name_notinstalled</xsl:when>
  11.                     <xsl:otherwise>name_installed</xsl:otherwise>
  12.                 </xsl:choose>
  13.                 </xsl:attribute>
  14.  
  15.                 <xsl:value-of select="name"/>
  16.  
  17.                 
  18.                 <img class="language" hspace="2" width="57" height="17">
  19.                 <xsl:choose>
  20.                     <xsl:when test="language[.='C++']"><xsl:attribute name="src">img/lang_cpp.gif</xsl:attribute></xsl:when>
  21.                     <xsl:when test="language[.='Managed']"><xsl:attribute name="src">img/lang_managed.gif</xsl:attribute></xsl:when>
  22.                     <xsl:otherwise><xsl:attribute name="src">img/spacer.gif</xsl:attribute></xsl:otherwise>
  23.                 </xsl:choose>
  24.                 </img>
  25.             </td>
  26.             <td valign="top" align="right">
  27.                 <table cellpadding="0" cellspacing="0" border="0">
  28.                 <tr>
  29.                     <td>
  30.                         <img class="language" hspace="8" width="44" height="20">
  31.                         <xsl:choose>
  32.                         <xsl:when test="@updated[.='true']"><xsl:attribute name="src">img/results_updated.gif</xsl:attribute></xsl:when>
  33.                             <xsl:when test="@new[.='true']"><xsl:attribute name="src">img/results_new.gif</xsl:attribute></xsl:when>
  34.                             <xsl:otherwise><xsl:attribute name="src">img/spacer.gif</xsl:attribute></xsl:otherwise>
  35.                         </xsl:choose>
  36.  
  37.                         </img>
  38.                     </td>
  39.                     <td>
  40.                         <img class="difficulty" width="90" height="19" hspace="10">
  41.                         <xsl:choose>
  42.                             <xsl:when test="complexity[. > 1999]"><xsl:attribute name="src">img/diff_advanced.gif</xsl:attribute></xsl:when>
  43.                             <xsl:when test="complexity[. > 999]"><xsl:attribute name="src">img/diff_intermediate.gif</xsl:attribute></xsl:when>
  44.                             <xsl:when test="complexity[. > 0]"><xsl:attribute name="src">img/diff_beginner.gif</xsl:attribute></xsl:when>
  45.                             <xsl:otherwise><xsl:attribute name="src">img/spacer.gif</xsl:attribute></xsl:otherwise>
  46.                         </xsl:choose>
  47.                         </img>
  48.                     </td>
  49.                     <td>
  50.                     <img class="difficulty" width="90" height="19">
  51.                         <xsl:choose>
  52.                             <xsl:when test="type[.='sample']"><xsl:attribute name="src">img/type_sample.gif</xsl:attribute></xsl:when>
  53.                             <xsl:when test="type[.='tutorial']"><xsl:attribute name="src">img/type_tutorial.gif</xsl:attribute></xsl:when>
  54.                             <xsl:when test="type[.='article']"><xsl:attribute name="src">img/type_article.gif</xsl:attribute></xsl:when>
  55.                             <xsl:when test="type[.='utility']"><xsl:attribute name="src">img/type_utility.gif</xsl:attribute></xsl:when>
  56.                             <xsl:when test="type[.='utilitysample']"><xsl:attribute name="src">img/type_utilitysample.gif</xsl:attribute></xsl:when>
  57.                         </xsl:choose>
  58.                     </img>
  59.                     </td>
  60.                 </tr>
  61.                 </table>
  62.             </td>
  63.             <td rowspan="4" valign="top" align="right">
  64.                 <xsl:attribute name="class">
  65.                 <xsl:choose>
  66.                     <xsl:when test="screenshot[.!='']">Screenshot</xsl:when>
  67.                     <xsl:otherwise>noScreenshot</xsl:otherwise>
  68.                 </xsl:choose>
  69.                 </xsl:attribute>
  70.  
  71.                 <img hspace="10" width="78" height="12" style="position: relative; top: -12px; left: -10px;">
  72.                 <xsl:choose>
  73.                     <xsl:when test="@installed[.='no']"><xsl:attribute name="src">img\results_not_installed.gif</xsl:attribute></xsl:when>
  74.                     <xsl:when test="@external[.='true']"><xsl:attribute name="src">img\results_external.gif</xsl:attribute></xsl:when>
  75.                     <xsl:otherwise><xsl:attribute name="src">img\spacer.gif</xsl:attribute></xsl:otherwise>
  76.                 </xsl:choose>
  77.                 </img>
  78.  
  79.                 
  80.                 <xsl:if test="screenshot[.!='']">
  81.                 <img width="90" border="0" onError="style.display = 'None'" style="position: relative; top: -5px">
  82.                     <xsl:attribute name="src">
  83.                     ..\..\<xsl:value-of select="folder"/><xsl:value-of select="screenshot"/>
  84.                     </xsl:attribute>
  85.                 </img>
  86.                 </xsl:if>
  87.                 
  88.             </td>
  89.             </tr>
  90.             <tr>
  91.             <td colspan="2" valign="top"><p class="description_highlight"></p></td>
  92.             </tr>
  93.             <tr>
  94.             <td colspan="2" valign="top"><p class="description"><xsl:value-of select="description"/></p><p></p></td>
  95.             </tr>
  96.             <tr>
  97.             <td colspan="2" valign="top" height="30" style="padding-left: 22px">
  98.                 <xsl:if test="exe[.!='']">
  99.                 <xsl:choose>
  100.                     <xsl:when test="@onX64[.='yes']">
  101.                         <a class="links">
  102.                         
  103.                         <xsl:if test="doc[.!='']"><xsl:attribute name="onclick">if (showDoc) window.location = document.getElementById("doc<xsl:value-of select="name"/><xsl:value-of select="language"/>")</xsl:attribute></xsl:if>
  104.                         <xsl:if test="readme[.!='']"><xsl:attribute name="onclick">if (showDoc) window.location = document.getElementById("doc<xsl:value-of select="name"/><xsl:value-of select="language"/>")</xsl:attribute></xsl:if>
  105.                             
  106.                         <xsl:attribute name="href">results.htm#"..\..\<xsl:value-of select="exefolder"/><xsl:value-of select="exe"/>"</xsl:attribute>
  107.                             <xsl:attribute name="title">..\..\<xsl:value-of select="exefolder"/><xsl:value-of select="exe"/></xsl:attribute>32-bit Executable<font style="text-decoration: none"> </font></a>
  108.  
  109.                         <xsl:choose>
  110.                             <xsl:when test="@x64[.='false']"></xsl:when>
  111.                             <xsl:otherwise>
  112.                             <a class="links">
  113.                                 
  114.                             <xsl:if test="doc[.!='']"><xsl:attribute name="onclick">if (showDoc) window.location = document.getElementById("doc<xsl:value-of select="name"/><xsl:value-of select="language"/>")</xsl:attribute></xsl:if>
  115.                             <xsl:if test="readme[.!='']"><xsl:attribute name="onclick">if (showDoc) window.location = document.getElementById("doc<xsl:value-of select="name"/><xsl:value-of select="language"/>")</xsl:attribute></xsl:if>
  116.                         
  117.                             <xsl:attribute name="href">results.htm#"..\..\<xsl:value-of select="exefolder"/>x64\<xsl:value-of select="exe"/>"</xsl:attribute>
  118.                                     <xsl:attribute name="title">..\..\<xsl:value-of select="exefolder"/>x64\<xsl:value-of select="exe"/></xsl:attribute>64-bit Executable<font style="text-decoration: none"> </font></a>
  119.                             </xsl:otherwise>
  120.                         </xsl:choose>
  121.                     </xsl:when>
  122.                     <xsl:otherwise>
  123.                     <a class="links">
  124.                             
  125.                                                 <xsl:if test="doc[.!='']"><xsl:attribute name="onclick">if (showDoc) window.location = document.getElementById("doc<xsl:value-of select="name"/><xsl:value-of select="language"/>")</xsl:attribute></xsl:if>
  126.                         <xsl:if test="readme[.!='']"><xsl:attribute name="onclick">if (showDoc) window.location = document.getElementById("doc<xsl:value-of select="name"/><xsl:value-of select="language"/>")</xsl:attribute></xsl:if>
  127.                         
  128.                             <xsl:attribute name="href">results.htm#"..\..\<xsl:value-of select="exefolder"/><xsl:value-of select="exe"/>"</xsl:attribute>
  129.                             <xsl:attribute name="title">..\..\<xsl:value-of select="exefolder"/><xsl:value-of select="exe"/></xsl:attribute>
  130.                             Executable<font style="text-decoration: none"> </font></a>
  131.                     </xsl:otherwise>
  132.                 </xsl:choose>
  133.                 </xsl:if>
  134.                 <xsl:if test="doc[.!='']">
  135.                 <a class="links">
  136.                     <xsl:attribute name="id">doc<xsl:value-of select="name"/><xsl:value-of select="language"/></xsl:attribute>
  137.                     <xsl:attribute name="href">results.htm#"<xsl:value-of select="doc"/>"</xsl:attribute>
  138.                     <xsl:attribute name="title"><xsl:value-of select="doc"/></xsl:attribute>
  139.                     Documentation<font style="text-decoration: none"> </font></a>
  140.                 </xsl:if>
  141.  
  142.                 <xsl:if test="readme[.!='']">
  143.                     <a class="links">
  144.                     <xsl:attribute name="id">doc<xsl:value-of select="name"/><xsl:value-of select="language"/></xsl:attribute>            
  145.                     <xsl:attribute name="href">results.htm#"..\..\<xsl:value-of select="folder"/><xsl:value-of select="readme"/>"</xsl:attribute>
  146.                     <xsl:attribute name="title">..\..\<xsl:value-of select="folder"/><xsl:value-of select="readme"/></xsl:attribute>
  147.                     Documentation<font style="text-decoration: none"> </font></a>
  148.                 </xsl:if>
  149.  
  150.                 <xsl:choose>
  151.                 <xsl:when test="install">
  152.                     <a class="links">
  153.                     <xsl:attribute name="href">results.htm#INSTALL:"..\..\<xsl:value-of select="folder"/><xsl:if test="install/@name[.!='']">/NAME<xsl:value-of select="install/@name"/></xsl:if><xsl:if test="install/@common[.='false']">/NOCOMMON</xsl:if><xsl:for-each select="install/reserved">/RESERVED<xsl:value-of/></xsl:for-each><xsl:for-each select="install/media">/MEDIA<xsl:value-of/></xsl:for-each><xsl:for-each select="install/additional">/ADDITIONAL<xsl:value-of select="@src" />:<xsl:value-of select="@dest" /></xsl:for-each>"
  154.                     </xsl:attribute>Install Project<font style="text-decoration: none"> </font></a>
  155.                 </xsl:when>
  156.  
  157.                 <xsl:when test="projectfile7[.!='']">
  158.                     <a class="links">
  159.                     <xsl:attribute name="href">results.htm#"..\..\<xsl:value-of select="folder"/><xsl:value-of select="projectfile7" />"
  160.                     </xsl:attribute>Project Files<font style="text-decoration: none"> </font></a>
  161.                 </xsl:when>                
  162.                 </xsl:choose>
  163.                 
  164.                 <xsl:if test="link[.!='']">
  165.                 <a class="links">
  166.                     <xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
  167.                     <xsl:attribute name="title"><xsl:value-of select="link"/></xsl:attribute>
  168.                     <xsl:attribute name="target">new</xsl:attribute>
  169.                     <xsl:value-of select="link/@name"/><font style="text-decoration: none"> </font></a>
  170.                 </xsl:if>
  171.             </td>
  172.             </tr>
  173.         </xsl:for-each>
  174.     </table>
  175.     </xsl:template>
  176. </xsl:stylesheet>
  177.