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

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- 
  3. This converts the office inventory report to mbsa xml format
  4. -->
  5.  
  6. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  7.     version="1.0">
  8.  
  9. <xsl:output method="xml" indent="yes"/>
  10.  
  11. <xsl:variable name="NoUpdatesMissingText" select="'NoUpdatesMissingTextHere'"></xsl:variable>
  12.  
  13. <xsl:param name="UpdateCount" select="count((//ADMINAPPLICABLE|//APPLICABLE)/PATCH[@EXPIRED!='True'])"/>
  14.  
  15. <xsl:template match="PATCH">
  16.     <xsl:param name="grade"/>
  17.     <xsl:param name="baseidneeded" select="@BASELINEIDREQUIRED"/>
  18.  
  19.     <Row>
  20.         <xsl:attribute name="Grade"><xsl:value-of select="$grade"/></xsl:attribute>
  21.         <Col>
  22.             <xsl:attribute name="URL"><xsl:value-of select="@URL"/></xsl:attribute>
  23.             <xsl:if test="@BASELINEIDREQUIRED">
  24.                 <xsl:attribute name="REQUIREDNAME">
  25.                     <xsl:value-of select="(//ADMINAPPLICABLE|//APPLICABLE)/PATCH[@EXPIRED!='True' and @PATCHID=$baseidneeded]/@NAME" />
  26.                 </xsl:attribute>
  27.             </xsl:if>
  28.  
  29.             <xsl:value-of select="@NAME"/>
  30.         </Col>
  31.     </Row>
  32. </xsl:template>
  33.  
  34. <xsl:template match="/">
  35. <Results>
  36.     <Check     ID="174" 
  37.             Grade="--filled in below--"
  38.             Type="5"
  39.             Cat="1"
  40.             Rank="12"
  41.             Name="Office Security Updates"
  42.             URL1="help/check5311.html"
  43.             URL2="help/check5311fix.html">
  44.  
  45.         <xsl:if test="/INVENTORY/@DETINFOBUILD">
  46.             <xsl:attribute name="DataVersionName">Office update database version:</xsl:attribute>
  47.             <xsl:attribute name="DataVersion">
  48.                 <xsl:value-of select="/INVENTORY/@DETINFOBUILD" />
  49.             </xsl:attribute>
  50.         </xsl:if>
  51.  
  52.         <xsl:if test="$UpdateCount > 0">
  53.  
  54.             <xsl:attribute name="Grade">2</xsl:attribute>
  55.  
  56.             <xsl:if test="$UpdateCount = 1">
  57.                 <Advice>1 security update is missing.</Advice>
  58.             </xsl:if>
  59.  
  60.             <xsl:if test="$UpdateCount > 1">
  61.                 <Advice><xsl:value-of select="$UpdateCount"/> security updates are missing.</Advice>
  62.             </xsl:if>
  63.  
  64.             <Detail>
  65.                 <Head>
  66.                     <Col>Update</Col>
  67.                 </Head>
  68.  
  69.                 <xsl:apply-templates select="//APPLICABLE/PATCH[@EXPIRED!='True']">
  70.                     <xsl:with-param name="grade">2</xsl:with-param>
  71.                 </xsl:apply-templates>
  72.                 <xsl:apply-templates select="//ADMINAPPLICABLE/PATCH[@EXPIRED!='True']">
  73.                     <xsl:with-param name="grade">6</xsl:with-param>
  74.                 </xsl:apply-templates>
  75.             </Detail>
  76.         </xsl:if>
  77.     
  78.         <xsl:if test="$UpdateCount = 0">
  79.             <xsl:attribute name="Grade">5</xsl:attribute>
  80.  
  81.             <Advice><xsl:value-of select="$NoUpdatesMissingText"/></Advice>
  82.         </xsl:if>
  83.  
  84.     </Check>
  85.  
  86. </Results>
  87. </xsl:template>
  88.  
  89. </xsl:stylesheet>