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.

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