Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
4.8 KiB

  1. <?xml version="1.0"?>
  2. <!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  4. <xsl:template match="RESULTS">
  5. <H3>Node: <xsl:value-of select="@NODE"/> - <xsl:value-of select="count(CIM/INSTANCE)"/> Instances of <xsl:value-of select="CIM/INSTANCE[1]/@CLASSNAME"/></H3>
  6. <table border="1">
  7. <xsl:for-each select="CIM/INSTANCE">
  8. <xsl:sort select="PROPERTY[@NAME='Name']|PROPERTY.ARRAY[@NAME='Name']|PROPERTY.REFERENCE[@NAME='name']"/>
  9. <tr style="background-color:#a0a0ff;font:10pt Tahoma;font-weight:bold;" align="left"><td colspan="2">
  10. <xsl:choose>
  11. <xsl:when test="PROPERTY[@NAME='Name']|PROPERTY.ARRAY[@NAME='Name']|PROPERTY.REFERENCE[@NAME='name']">
  12. <xsl:value-of select="PROPERTY[@NAME='Name']|PROPERTY.ARRAY[@NAME='Name']|PROPERTY.REFERENCE[@NAME='name']"/>
  13. </xsl:when>
  14. <xsl:when test="PROPERTY[@NAME='Description']|PROPERTY.ARRAY[@NAME='Description']|PROPERTY.REFERENCE[@NAME='Description']">
  15. <xsl:value-of select="PROPERTY[@NAME='Description']|PROPERTY.ARRAY[@NAME='Description']|PROPERTY.REFERENCE[@NAME='Description']"/>
  16. </xsl:when>
  17. <xsl:otherwise>INSTANCE</xsl:otherwise>
  18. </xsl:choose>
  19. <span style="height:1px;overflow-y:hidden">.</span></td></tr>
  20. <tr style="background-color:#c0c0c0;font:8pt Tahoma;">
  21. <td>Property Name</td><td>Value</td>
  22. </tr>
  23. <xsl:for-each select="PROPERTY|PROPERTY.ARRAY|PROPERTY.REFERENCE">
  24. <xsl:variable name="typevar" select="@TYPE"/>
  25. <xsl:choose>
  26. <xsl:when test="position() mod 2 &lt; 1">
  27. <tr style="background-color:#e0f0f0;font:10pt Tahoma;">
  28. <td>
  29. <xsl:value-of select="@NAME"/>
  30. </td>
  31. <td>
  32. <xsl:for-each select="VALUE|VALUE.ARRAY|VALUE.REFERENCE">
  33. <xsl:apply-templates select=".">
  34. <xsl:with-param name="type">
  35. <xsl:value-of select="$typevar"/>
  36. </xsl:with-param>
  37. </xsl:apply-templates>
  38. </xsl:for-each>
  39. <span style="height:1px;overflow-y:hidden">.</span>
  40. </td>
  41. </tr>
  42. </xsl:when>
  43. <xsl:otherwise>
  44. <tr style="background-color:#f0f0f0;font:10pt Tahoma;">
  45. <td>
  46. <xsl:value-of select="@NAME"/>
  47. </td>
  48. <td>
  49. <xsl:for-each select="VALUE|VALUE.ARRAY|VALUE.REFERENCE">
  50. <xsl:apply-templates select=".">
  51. <xsl:with-param name="type">
  52. <xsl:value-of select="$typevar"/>
  53. </xsl:with-param>
  54. </xsl:apply-templates>
  55. </xsl:for-each>
  56. <span style="height:1px;overflow-y:hidden">.</span>
  57. </td>
  58. </tr>
  59. </xsl:otherwise>
  60. </xsl:choose>
  61. </xsl:for-each>
  62. <tr style="background-color:#ffffff;font:10pt Tahoma;font-weight:bold;"><td colspan="2"><span style="height:1px;overflow-y:hidden">.</span></td></tr>
  63. </xsl:for-each>
  64. </table>
  65. </xsl:template>
  66. <xsl:template match="VALUE.ARRAY">
  67. <xsl:param name="type"/>
  68. {<xsl:for-each select="VALUE">
  69. <xsl:apply-templates select=".">
  70. <xsl:with-param name="type">
  71. <xsl:value-of select="$type"/>
  72. </xsl:with-param>
  73. <xsl:with-param name="isarray">true</xsl:with-param>
  74. <xsl:with-param name="includequotes">true</xsl:with-param>
  75. </xsl:apply-templates>
  76. <xsl:if test="position()!=last()">,</xsl:if>
  77. </xsl:for-each>}
  78. </xsl:template>
  79. <xsl:template match="VALUE">
  80. <xsl:param name="type"/>
  81. <xsl:param name="includequotes"/>
  82. <xsl:param name="isarray"/>
  83. <xsl:choose>
  84. <xsl:when test="$type='string'">
  85. <xsl:if test="$includequotes='true'">"</xsl:if><xsl:value-of select="."/><xsl:if test="$includequotes='true'">"</xsl:if>
  86. </xsl:when>
  87. <xsl:when test="$type='char16'">
  88. '<xsl:value-of select="."/>'
  89. </xsl:when>
  90. <xsl:when test="$type='uint16'or $type='uint32' or $type='uint64' or $type='uint8' or $type='real32'or $type='real64' or $type='sint16'or $type='sint32' or $type='sint64' or $type='sint8'">
  91. <xsl:if test="$isarray='true'"><xsl:value-of select="."/></xsl:if>
  92. <xsl:if test="not($isarray='true')"><div align="right"><xsl:value-of select="."/></div></xsl:if>
  93. </xsl:when>
  94. <xsl:otherwise>
  95. <xsl:value-of select="."/>
  96. </xsl:otherwise>
  97. </xsl:choose>
  98. </xsl:template>
  99. <xsl:template match="VALUE.REFERENCE"><xsl:apply-templates select="INSTANCEPATH/NAMESPACEPATH"/><xsl:apply-templates select="INSTANCEPATH/INSTANCENAME|INSTANCENAME"/></xsl:template>
  100. <xsl:template match="NAMESPACEPATH">\\<xsl:value-of select="HOST/text()"/><xsl:for-each select="LOCALNAMESPACEPATH/NAMESPACE">\<xsl:value-of select="@NAME"/></xsl:for-each>:</xsl:template>
  101. <xsl:template match="INSTANCENAME"><xsl:value-of select="@CLASSNAME"/><xsl:for-each select="KEYBINDING"><xsl:if test="position()=1">.</xsl:if><xsl:value-of select="@NAME"/>="<xsl:value-of select="KEYVALUE/text()"/>"<xsl:if test="position()!=last()">,</xsl:if></xsl:for-each></xsl:template>
  102. <xsl:template match="/" >
  103. <html>
  104. <xsl:apply-templates select="COMMAND/RESULTS"/>
  105. </html>
  106. </xsl:template>
  107. </xsl:stylesheet>