home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 June / PCpro_2006_06.ISO / files / mstools / MBaslineSASetup-EN.msi / Data.Cab / reportdetailsSQL.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2005-06-29  |  3.0 KB  |  71 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.     <xsl:variable name="InstanceName" select="'InstanceNameHere'"></xsl:variable>
  6.  
  7.     <xsl:variable name="ScoreLookup">
  8.       <c score="0" url="Graphics/dash.gif" alttext="Check Not Performed"/>
  9.       <c score="1" url="Graphics/excl_red.gif" alttext="Unable to scan"/>
  10.       <c score="2" url="Graphics/x_red.gif" alttext="Check failed (critical)"/>
  11.       <c score="3" url="Graphics/x_gold.gif" alttext="Check failed (non-critical)"/>
  12.       <c score="4" url="Graphics/astrx.gif" alttext="Best practice"/>
  13.       <c score="5" url="Graphics/chek_grn.gif" alttext="Check passed"/>
  14.       <c score="7" url="Graphics/info.gif" alttext="Additional information"/>
  15.       <c score="8" url="Graphics/star_blu.gif" alttext="Not approved"/>
  16.     </xsl:variable>
  17.     
  18.     <xsl:template match="SecScan">
  19.         <xsl:choose>
  20.         <xsl:when test='SQLInstance[@Name=$InstanceName]'>
  21.             <h1><xsl:value-of select="SQLInstance[@Name=$InstanceName]/Check[@ID=$CheckID]/Advice"/></h1>
  22.             <h2>Result Details for SQL Instance  <xsl:value-of select="$InstanceName"/><br /><br /><xsl:value-of select="Check[@ID=$CheckID]/Detail/@text"/></h2>
  23.             <table id="TableID" width="100%" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px #000000; padding-left: 10px; padding-right: 10px;">
  24.             <tr class="DetailHeader">
  25.                 <td class="ReportListHeader" style="width:40" align="center" valign="middle"><nobr>  Score  </nobr></td>
  26.                 <xsl:for-each select="SQLInstance[@Name=$InstanceName]/Check[@ID=$CheckID]/Detail/Head/Col">
  27.                     <td nowrap="nowrap">
  28.                         <xsl:value-of select="."/> 
  29.                     </td>
  30.                 </xsl:for-each>
  31.             </tr>
  32.             
  33.             <xsl:for-each select="SQLInstance[@Name=$InstanceName]/Check[@ID=$CheckID]/Detail">
  34.                 <xsl:apply-templates select="Row">
  35.                 </xsl:apply-templates>
  36.             </xsl:for-each>
  37.             </table>
  38.         </xsl:when>
  39.         </xsl:choose>
  40.     </xsl:template>
  41.  
  42.     <xsl:template match="Row">
  43.     <xsl:param name="score" select="@Grade"/>
  44.         <tr>
  45.             <td valign="top" align="center">
  46.                 <xsl:choose>
  47.                   <xsl:when test="../../@ID='121'">
  48.                     <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@url}" />
  49.                   </xsl:when>
  50.                   <xsl:otherwise>
  51.                     <IMG alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@url}" />
  52.                   </xsl:otherwise>
  53.                 </xsl:choose>    
  54.             </td>
  55.             <xsl:for-each select="Col">
  56.             <td valign="top">
  57.              <xsl:choose>
  58.               <xsl:when test="@URL and @URL != '' and @URL != ' '">
  59.                 <A target="_blank" href="{@URL}"><xsl:value-of select="."/></A>
  60.               </xsl:when>
  61.               <xsl:otherwise>
  62.                 <xsl:value-of select="."/>
  63.               </xsl:otherwise>
  64.             </xsl:choose>    
  65.             </td>
  66.             </xsl:for-each>
  67.         </tr>
  68.     </xsl:template>
  69.     
  70. </xsl:stylesheet>
  71.