home *** CD-ROM | disk | FTP | other *** search
/ Computer Active Guide 2009 April / CAGidas04.iso / Programos / Windows7UpgradeAdvisorSetup.exe / Windows7UpgradeAdvisor_32bit.msi / WUA / Sysspecdata / HTML / DEVTRANSFORM.XSL
Encoding:
Extensible Markup Language  |  2009-10-13  |  7.7 KB  |  197 lines

  1. <?xml version="1.0"?>
  2. <!-- ==================================================================== -->
  3. <!-- ============ Copyright (c) 2006  Microsoft Corporation ============= -->
  4. <!-- ==================================================================== -->
  5.  
  6.  
  7.  
  8.  
  9. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
  10. <xsl:output method="xml" indent="yes" />
  11.  
  12.  
  13.  
  14.  
  15. <!-- ============================================ -->
  16. <!-- ========== VARIABLE SECTION START ========== -->
  17. <!-- ============================================ -->
  18. <xsl:variable name="NEWLINE">
  19. <xsl:text> </xsl:text>
  20. </xsl:variable>
  21.  
  22. <xsl:variable name="LOWERCASE" select="'abcdefghijklmnopqrstuvwxyz'" />
  23. <xsl:variable name="UPPERCASE" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
  24. <!-- ========================================== -->
  25. <!-- ========== VARIABLE SECTION END ========== -->
  26. <!-- ========================================== -->
  27.  
  28.  
  29.  
  30.  
  31. <xsl:template match="/">
  32. <!-- ============================== -->
  33. <!-- ==== SystemList Transform ==== -->
  34. <!-- ============================== -->
  35. <xsl:if test="//SystemSpec">
  36.     <xsl:call-template name="CommonSystemList" />
  37. </xsl:if>
  38.  
  39. </xsl:template>
  40.  
  41. <!-- ====================================== -->
  42. <!-- ========== SystemList START ========== -->
  43. <!-- ====================================== -->
  44. <xsl:template name="CommonSystemList">
  45. <Log>
  46.     <!-- ====================================== -->
  47.     <!-- ============ Devices START =========== -->
  48.     <!-- ====================================== -->
  49.     <xsl:element name="DeviceList">
  50.  
  51.         <!-- ============================================== -->
  52.         <!-- ========== SystemSpec SECTION START ========== -->
  53.         <!-- ============================================== -->
  54.         <xsl:if test="//SystemSpec">
  55.         <xsl:element name="SystemSpec">
  56.  
  57.             <!-- =========================================================== -->
  58.             <!-- == BIOS INFORMATION SECTION                              == -->
  59.             <!-- =========================================================== -->
  60.             <xsl:element name="BiosInfo">
  61.  
  62.                 <xsl:attribute name="Manufacturer">
  63.                     <xsl:value-of select="//SystemSpec/PingBackInfo/@manufacturer" />
  64.                 </xsl:attribute>
  65.  
  66.                 <xsl:attribute name="Model">
  67.                     <xsl:value-of select="//SystemSpec/PingBackInfo/@model" />
  68.                 </xsl:attribute>
  69.  
  70.                 <xsl:attribute name="BiosName">
  71.                     <xsl:value-of select="//SystemSpec/PingBackInfo/@biosName" />
  72.                 </xsl:attribute>
  73.  
  74.                 <xsl:attribute name="BiosVersion">
  75.                     <xsl:value-of select="//SystemSpec/PingBackInfo/@biosVersion" />
  76.                 </xsl:attribute>
  77.  
  78.                 <xsl:attribute name="BiosDate">
  79.                     <xsl:value-of select="//SystemSpec/PingBackInfo/@biosDate" />
  80.                 </xsl:attribute>
  81.  
  82.             </xsl:element>
  83.  
  84.             <!-- =========================================================== -->
  85.             <!-- == MEDIA INFORMATION SECTION                             == -->
  86.             <!-- =========================================================== -->
  87.             <xsl:element name="MediaInfo">
  88.  
  89.                 <xsl:attribute name="DvdWriter">
  90.                     <xsl:value-of select="//SystemSpec/MediaInfo/@dvdWriter" />
  91.                 </xsl:attribute>
  92.  
  93.                 <xsl:attribute name="DvdReader">
  94.                     <xsl:value-of select="//SystemSpec/MediaInfo/@dvdReader" />
  95.                 </xsl:attribute>
  96.  
  97.             </xsl:element>
  98.  
  99.             <!-- =========================================================== -->
  100.             <!-- == Exclude any of the following:                         == -->
  101.             <!-- ==                                                       == -->
  102.             <!-- == InstalledDriver element without matchingID attribute  == -->
  103.             <!-- ==                                                       == -->
  104.             <!-- =========================================================== -->
  105.             <xsl:for-each select="//Device">
  106.  
  107.                     <xsl:element name="Device">
  108.  
  109.                         <xsl:attribute name="Id">
  110.                             <xsl:value-of select="./HWID[1]" />
  111.                         </xsl:attribute>
  112.  
  113.                         <xsl:for-each select="./HWID">
  114.                             <xsl:element name="HwId">
  115.                                 <xsl:attribute name="Id">
  116.                                     <xsl:value-of select="." />
  117.                                 </xsl:attribute>
  118.  
  119.                                 <xsl:attribute name="Sequence">
  120.                                     <xsl:value-of select="position()-1" />
  121.                                 </xsl:attribute>
  122.  
  123.                             </xsl:element>
  124.                         </xsl:for-each>
  125.  
  126.                         <xsl:for-each select="./COMPID">
  127.                             <xsl:element name="CompId">
  128.                                 <xsl:attribute name="Id">
  129.                                     <xsl:value-of select="." />
  130.                                 </xsl:attribute>
  131.  
  132.                                 <xsl:attribute name="Sequence">
  133.                                     <xsl:value-of select="position()-1" />
  134.                                 </xsl:attribute>
  135.  
  136.                             </xsl:element>
  137.                         </xsl:for-each>
  138.  
  139.                         <xsl:for-each select="./InstalledDriver">
  140.                             <xsl:element name="InstalledDriver">
  141.                                 <xsl:attribute name="MatchingId">
  142.                                     <xsl:value-of select="@matchingID" />
  143.                                 </xsl:attribute>
  144.  
  145.                                 <xsl:attribute name="DriverVerDate">
  146.                                     <xsl:value-of select="@driverVerDate" />
  147.                                 </xsl:attribute>
  148.  
  149.                                 <xsl:attribute name="DriverVerVersion">
  150.                                     <xsl:value-of select="@driverVerVersion" />
  151.                                 </xsl:attribute>
  152.  
  153.                                 <xsl:attribute name="Class">
  154.                                     <xsl:value-of select="@class" />
  155.                                 </xsl:attribute>
  156.  
  157.                                 <xsl:attribute name="Manufacturer">
  158.                                     <xsl:value-of select="@manufacturer" />
  159.                                 </xsl:attribute>
  160.  
  161.                                 <xsl:attribute name="Provider">
  162.                                     <xsl:value-of select="@provider" />
  163.                                 </xsl:attribute>
  164.  
  165.                                 <xsl:attribute name="Model">
  166.                                     <xsl:value-of select="@model" />
  167.                                 </xsl:attribute>
  168.  
  169.                             </xsl:element>
  170.                         </xsl:for-each>
  171.  
  172.                     </xsl:element>
  173.  
  174.             </xsl:for-each>
  175.  
  176.         </xsl:element>
  177.         </xsl:if>
  178.         <!-- ============================================ -->
  179.         <!-- ========== SystemSpec SECTION END ========== -->
  180.         <!-- ============================================ -->
  181.  
  182.     </xsl:element>
  183.     <!-- ====================================== -->
  184.     <!-- ============ Devices END ============= -->
  185.     <!-- ====================================== -->
  186. </Log>
  187.  
  188. </xsl:template>
  189. <!-- ====================================== -->
  190. <!-- ========== SystemList END ============ -->
  191. <!-- ====================================== -->
  192.  
  193. </xsl:stylesheet>
  194.  
  195.  
  196.  
  197.