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.

561 lines
16 KiB

  1. <?xml version="1.0"?>
  2. <!-- TODO: qualifier flavors here + extend XML translator to generate WMI-specific flavors too-->
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  4. <!-- Root template selects all children of the CIM tag -->
  5. <xsl:template match="/">
  6. <xsl:apply-templates select="CIM//CLASS"/>
  7. <xsl:apply-templates select="CIM//INSTANCE"/>
  8. </xsl:template>
  9. <!-- VALUE template formats a non-array property or qualifier value -->
  10. <xsl:template match="VALUE">
  11. <xsl:if match="PROPERTY/VALUE">=</xsl:if>
  12. <xsl:choose>
  13. <xsl:when match="*[@TYPE='string']/VALUE">"<xsl:value-of/>"</xsl:when>
  14. <xsl:when match="*[@TYPE='datetime']/VALUE">"<xsl:value-of/>"</xsl:when>
  15. <xsl:when match="*[@TYPE='char16']/VALUE">'<xsl:value-of/>'</xsl:when>
  16. <xsl:otherwise><xsl:value-of/></xsl:otherwise>
  17. </xsl:choose>
  18. <xsl:if match="VALUE[$not$ end()]">,</xsl:if>
  19. </xsl:template>
  20. <!-- VALUE.ARRAY template formats a single element from an array -->
  21. <!-- property or qualifier value -->
  22. <xsl:template match="VALUE.ARRAY">
  23. {<xsl:apply-templates/>}
  24. </xsl:template>
  25. <!-- VALUE.INDEXED template formats a single element from an array -->
  26. <!-- property or qualifier value -->
  27. <xsl:template match="VALUE.INDEXED">
  28. <xsl:choose>
  29. <xsl:when match="*[@TYPE='string']/VALUE.INDEXED">"<xsl:value-of/>"</xsl:when>
  30. <xsl:when match="*[@TYPE='datetime']/VALUE.INDEXED">"<xsl:value-of/>"</xsl:when>
  31. <xsl:when match="*[@TYPE='char16']/VALUE.INDEXED">'<xsl:value-of/>'</xsl:when>
  32. <xsl:otherwise><SPAN CLASS="mofvalue"><xsl:value-of/></SPAN></xsl:otherwise>
  33. </xsl:choose>
  34. <xsl:if match="VALUE.INDEXED[$not$ end()]">, </xsl:if>
  35. </xsl:template>
  36. <!-- VALUE.REFERENCE template formats a reference property value -->
  37. <xsl:template match="VALUE.REFERENCE">
  38. = "<xsl:apply-templates/>"
  39. </xsl:template>
  40. <xsl:template match="VALUE.REFERENCE/CLASSPATH">
  41. <xsl:apply-templates match="NAMESPACEPATH"/>:<xsl:value-of match="CLASSNAME"/>
  42. </xsl:template>
  43. <xsl:template match="VALUE.REFERENCE/INSTANCEPATH">
  44. <xsl:apply-templates match="NAMESPACEPATH"/>:<xsl:value-of match="CLASSNAME"/>.<xsl:apply-templates match="KEYBINDING"/>
  45. </xsl:template>
  46. <xsl:template match="NAMESPACEPATH">
  47. <xsl:if match="NAMESPACEPATH[HOST]">//<xsl:value-of match="HOST"/></xsl:if><xsl:apply-templates match="NAMESPACE"/>
  48. </xsl:template>
  49. <xsl:template match="NAMESPACE">/<xsl:value-of match="NAMESPACENODE"/><xsl:apply-templates match="NAMESPACE"/></xsl:template>
  50. <xsl:template match="KEYBINDING">
  51. <xsl:value-of match="KEYNAME"/>=<xsl:value-of match="KEYVALUE"/><xsl:if match="KEYBINDING[$not$ end()]">,</xsl:if>
  52. </xsl:template>
  53. <xsl:template match="KEYVALUE[VALUE]">
  54. <xsl:apply-templates match="VALUE"/>
  55. </xsl:template>
  56. <xsl:template match="KEYVALUE[VALUE.REFERENCE]">
  57. <xsl:apply-templates match="VALUE.REFERENCE"/>
  58. </xsl:template>
  59. <!-- INSTANCE template formats a single CIM non-association instance -->
  60. <xsl:template match="INSTANCE">
  61. <TABLE WIDTH="100%">
  62. <TR><TD BGCOLOR="red"><FONT SIZE="+2"><STRONG>
  63. <A LANGUAGE="javascript">
  64. <xsl:attribute name="ID">
  65. <xsl:value-of select="@CLASSNAME"/>
  66. </xsl:attribute>
  67. <xsl:attribute name="TITLE">
  68. <xsl:for-each select="QUALIFIER[@CLASSNAME = 'Description']">
  69. <xsl:value-of select="VALUE"/>
  70. </xsl:for-each>
  71. </xsl:attribute>
  72. <xsl:value-of select="@CLASSNAME"/>
  73. </A>
  74. instance
  75. </STRONG>
  76. </FONT></TD></TR>
  77. </TABLE><P/>
  78. <TABLE WIDTH="100%">
  79. <xsl:apply-templates select="QUALIFIER"/>
  80. </TABLE><P/>
  81. <FONT SIZE="-1">Key values are denoted with *</FONT>
  82. <P/>
  83. <xsl:if match="INSTANCE[PROPERTY $or$ PROPERTY.ARRAY]">
  84. <STRONG>Properties:</STRONG>
  85. <UL><TABLE WIDTH="90%">
  86. <xsl:apply-templates select="PROPERTY"/>
  87. <xsl:apply-templates select="PROPERTY.ARRAY"/>
  88. </TABLE></UL>
  89. </xsl:if>
  90. <xsl:if match="INSTANCE[PROPERTY.REFERENCE]">
  91. <STRONG>References:</STRONG>
  92. <UL><TABLE>
  93. <xsl:apply-templates select="PROPERTY.REFERENCE"/>
  94. </TABLE></UL>
  95. </xsl:if>
  96. <xsl:if match="INSTANCE[METHOD]">
  97. <STRONG>Methods:</STRONG>
  98. <UL><TABLE WIDTH="90%">
  99. <xsl:apply-templates select="METHOD"/>
  100. </TABLE></UL>
  101. </xsl:if>
  102. <!-- Associated object code. Needs context() support to work
  103. <P/>
  104. <STRONG>Associations:</STRONG>
  105. <P>
  106. <xsl:for-each select="ancestor(CIM)//CLASS/PROPERTY.REFERENCE[@REFERENCECLASS = context()/@NAME]">
  107. <LI/>
  108. <B><xsl:value-of select="./@REFERENCECLASS"/></B>
  109. is associated to
  110. <xsl:for-each select="ancestor(CLASS)/PROPERTY.REFERENCE[@NAME != context()/@NAME]">
  111. <B><A HREF="#" LANGUAGE="javascript" ID="Associated">
  112. <xsl:attribute name="onclick">
  113. return parent.options.control.GetClass("<xsl:value-of select="./@REFERENCECLASS"/>")
  114. </xsl:attribute>
  115. <xsl:value-of select="./@REFERENCECLASS"/></A></B>
  116. </xsl:for-each>
  117. as the <xsl:value-of select="./@NAME"/>
  118. property of the
  119. <B><A HREF="#" LANGUAGE="javascript" ID="Reference">
  120. <xsl:attribute name="onclick">
  121. return parent.options.control.GetClass("<xsl:value-of select="ancestor(CLASS)/@NAME"/>")
  122. </xsl:attribute>
  123. <xsl:value-of select="ancestor(CLASS)/@NAME"/></A></B>
  124. association.<P/>
  125. </xsl:for-each>
  126. </P>
  127. -->
  128. </xsl:template>
  129. <!-- CLASS template formats a single CIM non-association class -->
  130. <xsl:template match="CLASS">
  131. <TABLE WIDTH="100%">
  132. <TR><TD BGCOLOR="red"><FONT SIZE="+2"><STRONG>
  133. <A LANGUAGE="javascript">
  134. <xsl:attribute name="ID">
  135. <xsl:value-of select="@NAME"/>
  136. </xsl:attribute>
  137. <xsl:attribute name="TITLE">
  138. <xsl:for-each select="QUALIFIER[@NAME = 'Description']">
  139. <xsl:value-of select="VALUE"/>
  140. </xsl:for-each>
  141. </xsl:attribute>
  142. <xsl:value-of select="@NAME"/>
  143. </A>
  144. </STRONG>
  145. <xsl:if match="*[@SUPERCLASS]">
  146. : <xsl:value-of select="@SUPERCLASS"/>
  147. </xsl:if>
  148. </FONT></TD></TR>
  149. </TABLE><P/>
  150. <TABLE WIDTH="100%">
  151. <xsl:apply-templates select="QUALIFIER"/>
  152. </TABLE><P/>
  153. <FONT SIZE="-1">Key values are denoted with *</FONT>
  154. <P/>
  155. <xsl:if match="CLASS[PROPERTY $or$ PROPERTY.ARRAY]">
  156. <STRONG>Properties:</STRONG>
  157. <UL><TABLE WIDTH="90%">
  158. <xsl:apply-templates select="PROPERTY"/>
  159. <xsl:apply-templates select="PROPERTY.ARRAY"/>
  160. </TABLE></UL>
  161. </xsl:if>
  162. <xsl:if match="CLASS[PROPERTY.REFERENCE]">
  163. <STRONG>References:</STRONG>
  164. <UL><TABLE>
  165. <xsl:apply-templates select="PROPERTY.REFERENCE"/>
  166. </TABLE></UL>
  167. </xsl:if>
  168. <xsl:if match="CLASS[METHOD]">
  169. <STRONG>Methods:</STRONG>
  170. <UL><TABLE WIDTH="90%">
  171. <xsl:apply-templates select="METHOD"/>
  172. </TABLE></UL>
  173. </xsl:if>
  174. <!-- Associated object code. Needs context() support to work
  175. <P/>
  176. <STRONG>Associations:</STRONG>
  177. <P>
  178. <xsl:for-each select="ancestor(CIM)//CLASS/PROPERTY.REFERENCE[@REFERENCECLASS = context()/@NAME]">
  179. <LI/>
  180. <B><xsl:value-of select="./@REFERENCECLASS"/></B>
  181. is associated to
  182. <xsl:for-each select="ancestor(CLASS)/PROPERTY.REFERENCE[@NAME != context()/@NAME]">
  183. <B><A HREF="#" LANGUAGE="javascript" ID="Associated">
  184. <xsl:attribute name="onclick">
  185. return parent.options.control.GetClass("<xsl:value-of select="./@REFERENCECLASS"/>")
  186. </xsl:attribute>
  187. <xsl:value-of select="./@REFERENCECLASS"/></A></B>
  188. </xsl:for-each>
  189. as the <xsl:value-of select="./@NAME"/>
  190. property of the
  191. <B><A HREF="#" LANGUAGE="javascript" ID="Reference">
  192. <xsl:attribute name="onclick">
  193. return parent.options.control.GetClass("<xsl:value-of select="ancestor(CLASS)/@NAME"/>")
  194. </xsl:attribute>
  195. <xsl:value-of select="ancestor(CLASS)/@NAME"/></A></B>
  196. association.<P/>
  197. </xsl:for-each>
  198. </P>
  199. -->
  200. </xsl:template>
  201. <!-- QUALIFIER template formats a list of qualifier name/value pairs -->
  202. <xsl:template match="QUALIFIER">
  203. <TR><TD>
  204. </TD><TD WIDTH="100">
  205. <SPAN CLASS="mofqualifier"><xsl:value-of select="@NAME"/></SPAN>
  206. </TD><TD>
  207. <SPAN CLASS="mofqualifiervalue"><xsl:apply-templates/></SPAN>
  208. </TD></TR>
  209. </xsl:template>
  210. <!-- REFERENCE template formats a single CIM reference property -->
  211. <xsl:template match="PROPERTY.REFERENCE">
  212. <TR><TD WIDTH="100">
  213. <A HREF="#" LANGUAGE="javascript">
  214. <xsl:attribute name="ID">
  215. <xsl:value-of select="@role"/>
  216. </xsl:attribute>
  217. <xsl:attribute name="onclick">
  218. return parent.options.control.GetClass("<xsl:value-of select="@REFERENCECLASS"/>")
  219. </xsl:attribute>
  220. <xsl:value-of select="@REFERENCECLASS"/>
  221. </A>
  222. </TD><TD>
  223. <xsl:for-each select="QUALIFIER[@NAME = 'key']">*</xsl:for-each>
  224. <A LANGUAGE="javascript">
  225. <xsl:attribute name="ID">
  226. <xsl:value-of select="@NAME"/>
  227. </xsl:attribute>
  228. <xsl:attribute name="TITLE">
  229. <xsl:for-each select="QUALIFIER[@NAME = 'Description']">
  230. <xsl:value-of select="VALUE"/>
  231. </xsl:for-each>
  232. </xsl:attribute>
  233. <xsl:value-of select="@NAME"/>
  234. </A>
  235. </TD><TD>
  236. <xsl:apply-templates select="VALUE.REFERENCE"/>
  237. </TD></TR>
  238. <xsl:if select="PROPERTY.REFERENCE[@LOCAL = 'false']">
  239. <TR><TD></TD><TD><FONT SIZE="-1"><EM>
  240. (Class-origin: <xsl:value-of select="@CLASSORIGIN"/>)
  241. </EM></FONT></TD></TR>
  242. </xsl:if>
  243. <xsl:apply-templates select="QUALIFIER"/>
  244. </xsl:template>
  245. <!-- PROPERTY template formats a single CIM non-array property -->
  246. <xsl:template match="PROPERTY">
  247. <TR><TD WIDTH="100">
  248. <xsl:value-of select="@TYPE"/>
  249. </TD><TD>
  250. <xsl:for-each select="QUALIFIER[@NAME = 'key']">*</xsl:for-each>
  251. <SPAN CLASS="mofproperty">
  252. <xsl:value-of select="@NAME"/>
  253. </SPAN>
  254. <xsl:apply-templates select="VALUE"/>
  255. <!--
  256. <A LANGUAGE="javascript">
  257. <xsl:attribute name="ID">
  258. <xsl:value-of select="@NAME"/>
  259. </xsl:attribute>
  260. <xsl:attribute name="onclick">
  261. if (ver>=4){ExpandCollapse()};
  262. </xsl:attribute>
  263. <xsl:value-of select="@NAME"/>
  264. <xsl:apply-templates select="VALUE"/>
  265. </A><BR/>
  266. <DIV style="DISPLAY: none">
  267. <TABLE>
  268. <xsl:if select="PROPERTY[@LOCAL = 'false']">
  269. <TR><TD></TD><TD><FONT SIZE="-1"><EM>
  270. (Class-origin: <xsl:value-of select="@CLASSORIGIN"/>)
  271. </EM></FONT></TD></TR>
  272. </xsl:if>
  273. <xsl:apply-templates select="QUALIFIER"/>
  274. </TABLE>
  275. </DIV>
  276. -->
  277. </TD></TR>
  278. <xsl:if match="PROPERTY[@CLASSORIGIN]">
  279. <TR><TD></TD><TD><FONT SIZE="-1"><EM>
  280. (Class-origin: <xsl:value-of select="@CLASSORIGIN"/>)
  281. </EM></FONT></TD></TR>
  282. </xsl:if>
  283. <xsl:apply-templates select="QUALIFIER"/>
  284. </xsl:template>
  285. <!-- PROPERTY.ARRAY template formats a single CIM array property -->
  286. <xsl:template match="PROPERTY.ARRAY">
  287. <TR><TD WIDTH="100">
  288. <xsl:value-of select="@TYPE"/>
  289. </TD><TD>
  290. <xsl:for-each select="QUALIFIER[@NAME = 'key']">*</xsl:for-each>
  291. <SPAN CLASS="mofproperty">
  292. <xsl:value-of select="@NAME"/>
  293. [<xsl:value-of select="ARRAYSIZE"/>]
  294. </SPAN>
  295. </TD><TD>
  296. <xsl:apply-templates select="VALUE.INDEXED"/>
  297. </TD></TR>
  298. <xsl:if match="PROPERTY.ARRAY[@CLASSORIGIN]">
  299. <TR><TD></TD><TD><FONT SIZE="-1"><EM>
  300. (Class-origin: <xsl:value-of select="@CLASSORIGIN"/>)
  301. </EM></FONT></TD></TR>
  302. </xsl:if>
  303. <xsl:apply-templates select="QUALIFIER"/>
  304. </xsl:template>
  305. <!-- METHOD template formats a single CIM method -->
  306. <xsl:template match="METHOD">
  307. <TR><TD WIDTH="100">
  308. <xsl:value-of select="@TYPE"/>
  309. </TD><TD>
  310. <SPAN CLASS="mofmethod">
  311. <xsl:value-of select="@NAME"/>
  312. </SPAN>
  313. </TD><TD></TD></TR>
  314. <xsl:if match="METHOD[@CLASSORIGIN]">
  315. <TR><TD></TD><TD><FONT SIZE="-1"><EM>
  316. (Class-origin: <xsl:value-of select="@CLASSORIGIN"/>)
  317. </EM></FONT></TD></TR>
  318. </xsl:if>
  319. <xsl:apply-templates select="QUALIFIER"/>
  320. <TR><TD></TD><TD></TD><TD>(</TD></TR>
  321. <TR><TD></TD><TD></TD><TD><TABLE>
  322. <xsl:apply-templates select="PARAMETER"/>
  323. <xsl:apply-templates select="PARAMETER.ARRAY"/>
  324. <xsl:apply-templates select="PARAMETER.OBJECT"/>
  325. <xsl:apply-templates select="PARAMETER.OBJECTARRAY"/>
  326. <xsl:apply-templates select="PARAMETER.REFERENCE"/>
  327. <xsl:apply-templates select="PARAMETER.REFARRAY"/>
  328. </TABLE></TD></TR>
  329. <TR><TD></TD><TD></TD><TD>)</TD></TR>
  330. </xsl:template>
  331. <!-- PARAMETER template formats a single CIM method parameter -->
  332. <xsl:template match="PARAMETER">
  333. <TR><TD></TD><TD>
  334. <xsl:value-of select="@TYPE"/>
  335. </TD><TD>
  336. <A LANGUAGE="javascript">
  337. <xsl:attribute name="ID">
  338. <xsl:value-of select="@NAME"/>
  339. </xsl:attribute>
  340. <xsl:attribute name="TITLE">
  341. <xsl:for-each select="QUALIFIER[@NAME = 'Description']">
  342. <xsl:value-of select="VALUE"/>
  343. </xsl:for-each>
  344. </xsl:attribute>
  345. <xsl:value-of select="@NAME"/>
  346. </A>
  347. <xsl:apply-templates select="QUALIFIER"/>
  348. </TD></TR>
  349. </xsl:template>
  350. <!-- PARAMETER.ARRAY template formats a single CIM method parameter -->
  351. <xsl:template match="PARAMETER.ARRAY">
  352. <TR><TD></TD><TD>
  353. <xsl:value-of select="@TYPE"/>
  354. </TD><TD>
  355. <A LANGUAGE="javascript">
  356. <xsl:attribute name="ID">
  357. <xsl:value-of select="@NAME"/>
  358. </xsl:attribute>
  359. <xsl:attribute name="TITLE">
  360. <xsl:for-each select="QUALIFIER[@NAME = 'Description']">
  361. <xsl:value-of select="VALUE"/>
  362. </xsl:for-each>
  363. </xsl:attribute>
  364. <xsl:value-of select="@NAME"/>[]
  365. </A>
  366. <xsl:apply-templates select="QUALIFIER"/>
  367. </TD></TR>
  368. </xsl:template>
  369. <!-- PARAMETER.OBJECT template formats a single CIM method parameter -->
  370. <xsl:template match="PARAMETER.OBJECT">
  371. <TR><TD></TD><TD>
  372. <xsl:choose>
  373. <xsl:when match="*[@REFERENCECLASS]">
  374. <xsl:value-of select="@REFERENCECLASS"/> ref
  375. </xsl:when>
  376. <xsl:otherwise>
  377. object ref
  378. </xsl:otherwise>
  379. </xsl:choose>
  380. </TD><TD>
  381. <A LANGUAGE="javascript">
  382. <xsl:attribute name="ID">
  383. <xsl:value-of select="@NAME"/>
  384. </xsl:attribute>
  385. <xsl:attribute name="TITLE">
  386. <xsl:for-each select="QUALIFIER[@NAME = 'Description']">
  387. <xsl:value-of select="VALUE"/>
  388. </xsl:for-each>
  389. </xsl:attribute>
  390. <xsl:value-of select="@NAME"/>
  391. </A>
  392. <xsl:apply-templates select="QUALIFIER"/>
  393. </TD></TR>
  394. </xsl:template>
  395. <!-- PARAMETER.OBJECTARRAY template formats a single CIM method parameter -->
  396. <xsl:template match="PARAMETER.OBJECTARRAY">
  397. <TR><TD></TD><TD>
  398. <xsl:choose>
  399. <xsl:when match="*[@REFERENCECLASS]">
  400. <xsl:value-of select="@REFERENCECLASS"/> ref
  401. </xsl:when>
  402. <xsl:otherwise>
  403. object ref
  404. </xsl:otherwise>
  405. </xsl:choose>
  406. </TD><TD>
  407. <A LANGUAGE="javascript">
  408. <xsl:attribute name="ID">
  409. <xsl:value-of select="@NAME"/>
  410. </xsl:attribute>
  411. <xsl:attribute name="TITLE">
  412. <xsl:for-each select="QUALIFIER[@NAME = 'Description']">
  413. <xsl:value-of select="VALUE"/>
  414. </xsl:for-each>
  415. </xsl:attribute>
  416. <xsl:value-of select="@NAME"/>[]
  417. </A>
  418. <xsl:apply-templates select="QUALIFIER"/>
  419. </TD></TR>
  420. </xsl:template>
  421. <!-- PARAMETER.REFERENCE template formats a single CIM method parameter -->
  422. <xsl:template match="PARAMETER.REFERENCE">
  423. <TR><TD></TD><TD>
  424. <xsl:choose>
  425. <xsl:when match="*[@REFERENCECLASS]">
  426. <xsl:value-of select="@REFERENCECLASS"/> ref
  427. </xsl:when>
  428. <xsl:otherwise>
  429. object ref
  430. </xsl:otherwise>
  431. </xsl:choose>
  432. </TD><TD>
  433. <A LANGUAGE="javascript">
  434. <xsl:attribute name="ID">
  435. <xsl:value-of select="@NAME"/>
  436. </xsl:attribute>
  437. <xsl:attribute name="TITLE">
  438. <xsl:for-each select="QUALIFIER[@NAME = 'Description']">
  439. <xsl:value-of select="VALUE"/>
  440. </xsl:for-each>
  441. </xsl:attribute>
  442. <xsl:value-of select="@NAME"/>
  443. </A>
  444. <xsl:apply-templates select="QUALIFIER"/>
  445. </TD></TR>
  446. </xsl:template>
  447. <!-- PARAMETER.REFARRAY template formats a single CIM method parameter -->
  448. <xsl:template match="PARAMETER.REFARRAY">
  449. <TR><TD></TD><TD>
  450. <xsl:choose>
  451. <xsl:when match="*[@REFERENCECLASS]">
  452. <xsl:value-of select="@REFERENCECLASS"/> ref
  453. </xsl:when>
  454. <xsl:otherwise>
  455. object ref
  456. </xsl:otherwise>
  457. </xsl:choose>
  458. </TD><TD>
  459. <A LANGUAGE="javascript">
  460. <xsl:attribute name="ID">
  461. <xsl:value-of select="@NAME"/>
  462. </xsl:attribute>
  463. <xsl:attribute name="TITLE">
  464. <xsl:for-each select="QUALIFIER[@NAME = 'Description']">
  465. <xsl:value-of select="VALUE"/>
  466. </xsl:for-each>
  467. </xsl:attribute>
  468. <xsl:value-of select="@NAME"/>[]
  469. </A>
  470. <xsl:apply-templates select="QUALIFIER"/>
  471. </TD></TR>
  472. </xsl:template>
  473. </xsl:stylesheet>