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.

226 lines
9.0 KiB

  1. <?xml version="1.0"?>
  2. <!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  4. <!-- Root template selects all children of the CIM/DECLARATIONS tag -->
  5. <xsl:template match="/">
  6. <xsl:apply-templates select="COMMAND//RESULTS//CIM//CLASS"/>
  7. <xsl:apply-templates select="COMMAND//RESULTS//CIM//INSTANCE"/>
  8. </xsl:template>
  9. <!-- CLASS template formats a single CIM non-association class -->
  10. <xsl:template match="CLASS">
  11. <DIV CLASS="mofclass">
  12. <SPAN CLASS="mofqualifierset"><![CDATA[ ]]><xsl:apply-templates select="QUALIFIER"/><br/></SPAN>
  13. <SPAN CLASS="mofkeyword">class</SPAN>
  14. <xsl:value-of select="@NAME"/>
  15. <xsl:apply-templates select="CLASSPATH"/>
  16. <xsl:if match="*[@SUPERCLASS]">
  17. <SPAN CLASS="mofsymbol">: </SPAN><xsl:value-of select="@SUPERCLASS"/>
  18. </xsl:if>
  19. <BR/>
  20. <SPAN CLASS="mofsymbol">{</SPAN><BR/>
  21. <xsl:apply-templates select="PROPERTY"/>
  22. <xsl:apply-templates select="PROPERTY.ARRAY"/>
  23. <xsl:apply-templates select="PROPERTY.REFERENCE"/>
  24. <xsl:apply-templates select="METHOD"/>
  25. <SPAN CLASS="mofsymbol">};</SPAN>
  26. </DIV>
  27. </xsl:template>
  28. <!-- QUALIFIER template formats a list of qualifier name/value pairs -->
  29. <xsl:template match="QUALIFIER">
  30. <xsl:if match="QUALIFIER[0]"><SPAN CLASS="mofsymbol">[</SPAN></xsl:if>
  31. <SPAN CLASS="mofqualifier"><xsl:value-of select="@NAME"/></SPAN>
  32. <SPAN CLASS="mofsymbol">(</SPAN><xsl:apply-templates/><SPAN CLASS="mofsymbol">)</SPAN><xsl:if match="QUALIFIER[$not$ end()]">,
  33. </xsl:if>
  34. <xsl:if match="QUALIFIER[end()]"><SPAN CLASS="mofsymbol">]</SPAN>
  35. </xsl:if>
  36. </xsl:template>
  37. <!-- VALUE template formats a non-array property or qualifier value -->
  38. <xsl:template match="VALUE">
  39. <xsl:if match="PROPERTY/VALUE"><SPAN CLASS="mofsymbol">=</SPAN></xsl:if>
  40. <xsl:choose>
  41. <xsl:when match="*[@TYPE='string']/VALUE"><SPAN CLASS="mofstring">"<xsl:value-of/>"</SPAN></xsl:when>
  42. <xsl:when match="*[@TYPE='datetime']/VALUE"><SPAN CLASS="mofstring">"<xsl:value-of/>"</SPAN></xsl:when>
  43. <xsl:when match="*[@TYPE='char16']/VALUE"><SPAN CLASS="mofchar">'<xsl:value-of/>'</SPAN></xsl:when>
  44. <xsl:otherwise><SPAN CLASS="mofvalue"><xsl:value-of/></SPAN></xsl:otherwise>
  45. </xsl:choose>
  46. </xsl:template>
  47. <!-- VALUE.ARRAY/VALUE template formats an array or qualifier property -->
  48. <!-- value element -->
  49. <xsl:template match="VALUE.ARRAY/VALUE">
  50. <xsl:choose>
  51. <xsl:when match="*[@TYPE='string']/VALUE.ARRAY/VALUE"><SPAN CLASS="mofstring">"<xsl:value-of/>"</SPAN></xsl:when>
  52. <xsl:when match="*[@TYPE='datetime']/VALUE.ARRAY/VALUE"><SPAN CLASS="mofstring">"<xsl:value-of/>"</SPAN></xsl:when>
  53. <xsl:when match="*[@TYPE='char16']/VALUE.ARRAY/VALUE"><SPAN CLASS="mofchar">'<xsl:value-of/>'</SPAN></xsl:when>
  54. <xsl:otherwise><SPAN CLASS="mofvalue"><xsl:value-of/></SPAN></xsl:otherwise>
  55. </xsl:choose>
  56. <xsl:if match="VALUE[$not$ end()]">,</xsl:if>
  57. </xsl:template>
  58. <!-- VALUE.ARRAY template formats an array property or qualifier value -->
  59. <xsl:template match="VALUE.ARRAY">
  60. <xsl:if match="PROPERTY.ARRAY/VALUE.ARRAY"><SPAN CLASS="mofsymbol">=</SPAN></xsl:if>
  61. <SPAN CLASS="mofsymbol">{</SPAN><xsl:apply-templates select="VALUE"/><SPAN CLASS="mofsymbol">}</SPAN>
  62. </xsl:template>
  63. <!-- CLASSPATH template -->
  64. <xsl:template match="CLASSPATH">
  65. <xsl:value-of select="@CLASSNAME"/>
  66. </xsl:template>
  67. <!-- PROPERTY template formats a single CIM non-array property -->
  68. <xsl:template match="PROPERTY">
  69. <DD>
  70. <DIV CLASS="mofproperty">
  71. <SPAN CLASS="mofqualifierset"><![CDATA[ ]]><xsl:apply-templates select="QUALIFIER"/></SPAN>
  72. <SPAN CLASS="mofkeyword"><xsl:value-of select="@TYPE"/></SPAN>
  73. <SPAN CLASS="mofproperty"><xsl:value-of select="@NAME"/></SPAN>
  74. <xsl:apply-templates select="VALUE"/>
  75. <SPAN CLASS="mofsymbol">;</SPAN><BR/>
  76. </DIV>
  77. </DD>
  78. </xsl:template>
  79. <!-- PROPERTY.ARRAY template formats a single CIM array property -->
  80. <xsl:template match="PROPERTY.ARRAY">
  81. <DD>
  82. <DIV CLASS="mofproperty">
  83. <SPAN CLASS="mofqualifierset"><![CDATA[ ]]><xsl:apply-templates select="QUALIFIER"/></SPAN>
  84. <SPAN CLASS="mofkeyword"><xsl:value-of select="@TYPE"/></SPAN>
  85. <SPAN CLASS="mofproperty"><xsl:value-of select="@NAME"/></SPAN>
  86. <SPAN CLASS="mofsymbol">[</SPAN><xsl:value-of select="@ARRAYSIZE"/><SPAN CLASS="mofsymbol">]</SPAN>
  87. <xsl:apply-templates select="VALUE.ARRAY"/><SPAN CLASS="mofsymbol">;</SPAN><BR/>
  88. </DIV>
  89. </DD>
  90. </xsl:template>
  91. <!-- METHOD template formats a single CIM method -->
  92. <xsl:template match="METHOD">
  93. <DIV CLASS="mofmethod">
  94. <SPAN CLASS="mofqualifierset"><![CDATA[ ]]><xsl:apply-templates select="QUALIFIER"/></SPAN>
  95. <SPAN CLASS="mofkeyword"><xsl:value-of select="@TYPE"/></SPAN>
  96. <SPAN CLASS="mofmethod"><xsl:value-of select="@NAME"/></SPAN>
  97. <SPAN CLASS="mofsymbol">(</SPAN>
  98. <xsl:apply-templates select="METHODPARAMETER"/>
  99. <SPAN CLASS="mofsymbol">);</SPAN>
  100. </DIV>
  101. </xsl:template>
  102. <!-- METHODPARAMETER template formats a single CIM method parameter -->
  103. <xsl:template match="METHODPARAMETER">
  104. <DIV CLASS="mofmethodparameter">
  105. <SPAN CLASS="mofqualifierset"><![CDATA[ ]]><xsl:apply-templates select="QUALIFIER"/></SPAN>
  106. <xsl:choose>
  107. <xsl:when match="METHODPARAMETER/PARAMETER">
  108. <SPAN CLASS="mofkeyword"><xsl:value-of select="METHODPARAMETER/PARAMETER[@TYPE]"/></SPAN>
  109. </xsl:when>
  110. <xsl:when match="METHODPARAMETER/PARAMETER.REFERENCE">
  111. <SPAN CLASS="mofkeyword">object ref</SPAN>
  112. </xsl:when>
  113. <xsl:when match="METHODPARAMETER/PARAMETER.REFERENCE[@REFERENCECLASS]">
  114. <SPAN CLASS="mofkeyword"><xsl:value-of select="METHODPARAMETER/PARAMETER.REFERENCE[@REFERENCECLASS]"/> ref</SPAN>
  115. </xsl:when>
  116. </xsl:choose>
  117. <xsl:value-of select="@NAME"/><xsl:if match="METHODPARAMETER[$not$ end()]"><SPAN CLASS="mofsymbol">,</SPAN>
  118. </xsl:if>
  119. </DIV>
  120. </xsl:template>
  121. <!-- INSTANCE template formats a single CIM non-association instance -->
  122. <xsl:template match="INSTANCE">
  123. <DIV CLASS="mofinstance">
  124. <SPAN CLASS="mofqualifierset"><![CDATA[ ]]><xsl:apply-templates select="QUALIFIER"/><br/></SPAN>
  125. <SPAN CLASS="mofkeyword">instance of</SPAN>
  126. <xsl:value-of select="@CLASSNAME"/>
  127. <SPAN CLASS="mofsymbol">{</SPAN><BR/>
  128. <DL>
  129. <xsl:apply-templates select="PROPERTY"/>
  130. <xsl:apply-templates select="PROPERTY.ARRAY"/>
  131. <xsl:apply-templates select="PROPERTY.REFERENCE"/>
  132. </DL>
  133. <SPAN CLASS="mofsymbol">};</SPAN>
  134. </DIV>
  135. </xsl:template>
  136. <!-- VALUE.REFERENCE template formats a reference property value -->
  137. <xsl:template match="VALUE.REFERENCE">
  138. <SPAN CLASS="mofsymbol">=</SPAN>
  139. <SPAN CLASS="mofstring">"<xsl:apply-templates/>"</SPAN>
  140. </xsl:template>
  141. <xsl:template match="KEYBINDING/VALUE.REFERENCE">
  142. <SPAN CLASS="mofstring">"<xsl:apply-templates/>"</SPAN>
  143. </xsl:template>
  144. <xsl:template match="VALUE.REFERENCE/CLASSPATH">
  145. <xsl:apply-templates select="NAMESPACEPATH"/>:<xsl:value-of select="@CLASSNAME"/>
  146. </xsl:template>
  147. <xsl:template match="INSTANCEPATH">
  148. <xsl:apply-templates select="NAMESPACEPATH"/>:<xsl:apply-templates select="INSTANCENAME"/>
  149. </xsl:template>
  150. <xsl:template match="INSTANCENAME">
  151. <xsl:value-of select="@CLASSNAME"/>.<xsl:for-each select="KEYBINDING"><xsl:apply-templates select="."/></xsl:for-each>
  152. </xsl:template>
  153. <!-- NAMESPACEPATH template formats a reference property value -->
  154. <xsl:template match="NAMESPACEPATH">
  155. <xsl:apply-templates/>
  156. </xsl:template>
  157. <xsl:template match="HOST">\\<xsl:value-of select="."/></xsl:template>
  158. <xsl:template match="LOCALNAMESPACEPATH"><xsl:apply-templates select="NAMESPACE"/></xsl:template>
  159. <xsl:template match="NAMESPACE">\<xsl:value-of select="@NAME"/></xsl:template>
  160. <!-- KEYBINDING template formats a reference property value -->
  161. <xsl:template match="KEYBINDING">
  162. <xsl:value-of select="@NAME"/>=<xsl:apply-templates select="KEYVALUE"/><xsl:if match="KEYBINDING[$not$ end()]">,</xsl:if>
  163. </xsl:template>
  164. <xsl:template match="KEYVALUE">
  165. <xsl:choose>
  166. <xsl:when match="*[@TYPE='numeric']/VALUE"><SPAN CLASS="mofvalue"><xsl:value-of/></SPAN></xsl:when>
  167. <xsl:when match="*[@TYPE='boolean']/VALUE"><SPAN CLASS="mofvalue"><xsl:value-of/></SPAN></xsl:when>
  168. <xsl:otherwise><SPAN CLASS="mofstring">"<xsl:value-of/>"</SPAN></xsl:otherwise>
  169. </xsl:choose>
  170. </xsl:template>
  171. <!-- PROPERTY.REFERENCE template formats a single CIM reference property -->
  172. <xsl:template match="PROPERTY.REFERENCE">
  173. <DIV CLASS="mofproperty">
  174. <SPAN CLASS="mofqualifierset"><![CDATA[ ]]><xsl:apply-templates select="QUALIFIER"/></SPAN>
  175. <SPAN CLASS="mofkeyword">
  176. <xsl:choose>
  177. <xsl:when match="*[@REFERENCECLASS]"><xsl:value-of select="@REFERENCECLASS"/> ref</xsl:when>
  178. <xsl:otherwise>object ref</xsl:otherwise>
  179. </xsl:choose>
  180. </SPAN>
  181. <SPAN CLASS="mofproperty"><xsl:value-of select="@NAME"/></SPAN>
  182. <xsl:apply-templates select="VALUE.REFERENCE"/>
  183. <SPAN CLASS="mofsymbol">;</SPAN><BR/>
  184. </DIV>
  185. </xsl:template>
  186. </xsl:stylesheet>