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.

240 lines
9.1 KiB

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