home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 September / Chip_2004-09_cd1.bin / zkuste / system / download / secanal / MBSASetup-en.msi / Data.Cab / reportdetails.xsl < prev    next >
Extensible Markup Language  |  2004-01-16  |  4KB  |  82 lines

  1. <?xml version="1.0"?> 
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.     
  4.     <xsl:variable name="CheckID" select="'CheckIDHere'"></xsl:variable>
  5.  
  6.     <xsl:variable name="ScoreLookup">
  7.       <c score="0" url="Graphics/dash.gif" alttext="Check Not Performed"/>
  8.       <c score="1" url="Graphics/excl_red.gif" alttext="Unable to scan"/>
  9.       <c score="2" url="Graphics/x_red.gif" alttext="Check failed (critical)"/>
  10.       <c score="3" url="Graphics/x_gold.gif" alttext="Check failed (non-critical)"/>
  11.       <c score="4" url="Graphics/astrx.gif" alttext="Best practice"/>
  12.       <c score="5" url="Graphics/chek_grn.gif" alttext="Check passed"/>
  13.       <c score="7" url="Graphics/info.gif" alttext="Additional information"/>
  14.     </xsl:variable>
  15.     
  16.     <xsl:template match="SecScan">
  17.         
  18.             <h1><xsl:value-of select="Check[@ID=$CheckID]/Advice"/></h1>
  19.             <h2>Result Details<br /><br /><xsl:value-of select="Check[@ID=$CheckID]/Detail/@text"/></h2>
  20.             <table id="TableID" width="100%" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px #000000; padding-left: 10px; padding-right: 10px;">
  21.             <tr class="DetailHeader" >
  22.                 <td style="width:40" align="center" valign="middle"><nobr>  Score  </nobr></td>
  23.                 <xsl:for-each select="Check[@ID=$CheckID]/Detail/Head/Col">
  24.                     <td nowrap="nowrap">
  25.                         <xsl:value-of select="."/> 
  26.                     </td>
  27.                 </xsl:for-each>
  28.             </tr>
  29.             
  30.             <xsl:for-each select="Check[@ID=$CheckID]/Detail">
  31.                 <xsl:apply-templates select="Row">
  32.                 </xsl:apply-templates>
  33.             </xsl:for-each>
  34.             </table>
  35.     </xsl:template>
  36.  
  37.     <xsl:template match="Row">
  38.     <xsl:param name="score" select="@Grade"/>
  39.         <tr>
  40.             <td valign="top" align="center">
  41.                 <xsl:choose>
  42.                   <xsl:when test="../../@ID='121'">
  43.                     <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@url}" />
  44.                   </xsl:when>
  45.                   <xsl:when test="../../@ID='10121'">
  46.                     <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@url}" />
  47.                   </xsl:when>
  48.                   <xsl:when test="../../@ID='178' or ../../@ID='10178' or ../../@ID='20178'">
  49.                     <xsl:choose>
  50.                       <xsl:when test="@Grade='0'">
  51.                         <IMG alt="" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@url}" />
  52.                       </xsl:when>
  53.                       <xsl:when test="@Grade='4'">
  54.                         <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@url}" />
  55.                       </xsl:when>
  56.                       <xsl:otherwise>
  57.                         <IMG alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@url}" />
  58.                       </xsl:otherwise>
  59.                     </xsl:choose>
  60.                   </xsl:when>
  61.                   <xsl:otherwise>
  62.                     <IMG alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@url}" />
  63.                   </xsl:otherwise>
  64.                 </xsl:choose>    
  65.             </td>
  66.             <xsl:for-each select="Col">
  67.             <td valign="top">
  68.              <xsl:choose>
  69.               <xsl:when test="@URL and @URL != '' and @URL != ' '">
  70.                 <A target="_blank" href="{@URL}"><xsl:value-of select="."/></A>
  71.               </xsl:when>
  72.               <xsl:otherwise>
  73.                 <xsl:value-of select="."/>
  74.               </xsl:otherwise>
  75.             </xsl:choose>    
  76.             </td>
  77.             </xsl:for-each>
  78.         </tr>
  79.     </xsl:template>
  80.     
  81. </xsl:stylesheet>
  82.