Source code of Windows XP (NT5)
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.

240 lines
9.0 KiB

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