2005-11-08 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / tools / corcompare / mono-api.xsl
1 <?xml version="1.0" ?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
4         <xsl:output method="html" indent="yes"/>
5         <!--    <xsl:output method="xml"/>-->
6         <xsl:strip-space elements="*"/>
7
8         <xsl:template match="/">
9 <!--
10                 <HTML>
11                         <HEAD>
12                                 <TITLE>
13                                         Mono Class Library Status
14                                 </TITLE>
15                                 <SCRIPT src="cormissing.js"></SCRIPT>
16                                 <LINK rel="stylesheet" type="text/css" href="cormissing.css"></LINK>
17                         </HEAD>
18                         <BODY onLoad="onLoad();">
19                                 <P>
20                                         <H1>Mono Class Library Status</H1>
21                                 </P>
22 -->
23                                 <p>
24                                         <table>
25                                                 <tr>
26                                                         <td> <input type="checkbox" ID="todo" onClick="selectTodo();" checked="1"/> </td>
27                                                         <td> <img src="cm/st.gif"/> </td>
28                                                         <td> TODO </td>
29                                                         <td width="20"/>
30                                                         <td> <input type="checkbox" ID="missing" onClick="selectMissing();" checked="1"/> </td>
31                                                         <td> <img src="cm/sm.gif"/> </td>
32                                                         <td> Missing </td>
33                                                 </tr>
34                                                 <tr>
35                                                         <td> <input type="checkbox" ID="extra" onClick="selectExtra();" checked="1"/> </td>
36                                                         <td> <img src="cm/sx.gif"/> </td>
37                                                         <td> Extra </td>
38                                                         <td width="20"/>
39                                                         <td> <input type="checkbox" ID="errors" onClick="selectErrors();" checked="1"/> </td>
40                                                         <td> <img src="cm/se.gif"/> </td>
41                                                         <td> Errors </td>
42                                                 </tr>
43                                                 <tr>
44                                                         <td> </td>
45                                                         <td> <img src="cm/sc.gif"/> </td>
46                                                         <td> Completed </td>
47                                                 </tr>
48                                         </table>
49
50                                         <table>
51                                                 <tr>
52                                                         <td>
53                                                                 <input type="checkbox" ID="ComVisible" onClick="toggleAttributeFilter('ComVisible');" checked="1" />
54                                                         </td>
55                                                         <td> ComVisibleAttribute </td>
56                                                 </tr>
57                                                 <tr>
58                                                         <td>
59                                                                 <input type="checkbox" ID="DebuggerDisplay" onClick="toggleAttributeFilter('DebuggerDisplay');" checked="1" />
60                                                         </td>
61                                                         <td> DebuggerDisplayAttribute </td>
62                                                 </tr>
63                                         </table>
64
65                                 </p>
66                                 <div ID="ROOT">
67                                         <xsl:apply-templates/>
68                                 </div>
69                                 <p>
70                                         Legend :<br/>
71                                         <table>
72                                                 <tr>
73                                                         <td> <img src="cm/y.gif"/> </td>
74                                                         <td> Assembly </td>
75                                                         <td width="20"/>
76                                                         <td> <img src="cm/n.gif"/> </td>
77                                                         <td> Namespace </td>
78                                                         <td width="20"/>
79                                                         <td> <img src="cm/c.gif"/> </td>
80                                                         <td> Class </td>
81                                                         <td width="20"/>
82                                                         <td> <img src="cm/s.gif"/> </td>
83                                                         <td> Struct </td>
84                                                 <tr>
85                                                 </tr>
86                                                         <td> <img src="cm/i.gif"/> </td>
87                                                         <td> Interface </td>
88                                                         <td width="20"/>
89                                                         <td> <img src="cm/d.gif"/> </td>
90                                                         <td> Delegate </td>
91                                                         <td width="20"/>
92                                                         <td> <img src="cm/en.gif"/> </td>
93                                                         <td> Enum </td>
94                                                         <td width="20"/>
95                                                         <td> <img src="cm/m.gif"/> </td>
96                                                         <td> Method </td>
97                                                 </tr>
98                                                 <tr>
99                                                         <td> <img src="cm/f.gif"/> </td>
100                                                         <td> Field </td>
101                                                         <td width="20"/>
102                                                         <td> <img src="cm/p.gif"/> </td>
103                                                         <td> Property </td>
104                                                         <td width="20"/>
105                                                         <td> <img src="cm/e.gif"/> </td>
106                                                         <td> Event </td>
107                                                         <td width="20"/>
108                                                         <td> <img src="cm/r.gif"/> </td>
109                                                         <td> Attribute </td>
110                                                 </tr>
111                                         </table>
112
113                                 </p>
114 <!--
115                         </BODY>
116                 </HTML>
117 -->
118         </xsl:template>
119
120
121
122         <!-- assembly -->
123         <xsl:template match="/assemblies">
124                 <xsl:apply-templates select="assembly">
125                         <xsl:sort select="@name"/>
126                 </xsl:apply-templates>
127         </xsl:template>
128
129         <xsl:template match="assembly">
130                 <div>
131                         <xsl:call-template name="ELEMENT">
132                                 <xsl:with-param name="class">y</xsl:with-param>
133                         </xsl:call-template>
134                         <xsl:if test="not(@presence)">
135                                 <xsl:apply-templates/>
136                         </xsl:if>
137                 </div>
138         </xsl:template>
139
140
141         <!-- namespace -->
142         <xsl:template match="namespaces">
143                 <xsl:apply-templates select="namespace">
144                         <xsl:sort select="@name"/>
145                 </xsl:apply-templates>
146         </xsl:template>
147
148         <xsl:template match="namespace">
149                 <div>
150                         <xsl:call-template name="ELEMENT">
151                                 <xsl:with-param name="class">n</xsl:with-param>
152                         </xsl:call-template>
153                         <xsl:if test="not(@presence)">
154                                 <xsl:apply-templates/>
155                         </xsl:if>
156                 </div>
157         </xsl:template>
158
159
160         <xsl:template match="namespace/classes">
161                 <xsl:apply-templates select="class[@type='interface']">
162                         <xsl:sort select="@name"/>
163                 </xsl:apply-templates>
164                 <xsl:apply-templates select="class[@type='class']">
165                         <xsl:sort select="@name"/>
166                 </xsl:apply-templates>
167                 <xsl:apply-templates select="class[@type='struct']">
168                         <xsl:sort select="@name"/>
169                 </xsl:apply-templates>
170                 <xsl:apply-templates select="class[@type='delegate']">
171                         <xsl:sort select="@name"/>
172                 </xsl:apply-templates>
173                 <xsl:apply-templates select="class[@type='enum']">
174                         <xsl:sort select="@name"/>
175                 </xsl:apply-templates>
176         </xsl:template>
177
178
179         <!-- class -->
180         <xsl:template match="class[@type='class']">
181                 <div>
182                         <xsl:call-template name="ELEMENT">
183                                 <xsl:with-param name="class">c</xsl:with-param>
184                         </xsl:call-template>
185                         <xsl:if test="(@missing_total or @todo_total or @extra_total or @warning_total or @error) and not(@presence)">
186                                 <xsl:apply-templates select="attributes"/>
187                                 <xsl:apply-templates select="interfaces"/>
188                                 <xsl:apply-templates select="constructors"/>
189                                 <xsl:apply-templates select="./*[local-name() != 'attributes' and local-name() != 'constructors' and local-name() != 'interfaces']"/>
190                         </xsl:if>
191                 </div>
192         </xsl:template>
193
194
195         <!-- struct -->
196         <xsl:template match="class[@type='struct'][@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
197                 <div>
198                         <xsl:call-template name="ELEMENT">
199                                 <xsl:with-param name="class">s</xsl:with-param>
200                         </xsl:call-template>
201                         <xsl:if test="not(@presence)">
202                                 <xsl:apply-templates/>
203                         </xsl:if>
204                 </div>
205         </xsl:template>
206
207
208
209         <!-- interface types -->
210         <xsl:template match="class[@type='interface']">
211                 <xsl:apply-templates select="class[@type='interface']">
212                         <xsl:sort select="@name"/>
213                 </xsl:apply-templates>
214         </xsl:template>
215
216         <xsl:template match="class[@type='interface'][@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
217                 <div>
218                         <xsl:call-template name="ELEMENT">
219                                 <xsl:with-param name="class">i</xsl:with-param>
220                         </xsl:call-template>
221                         <xsl:if test="not(@presence)">
222                                 <xsl:apply-templates/>
223                         </xsl:if>
224                 </div>
225         </xsl:template>
226
227         <!-- interfaces implemented by Types -->
228         <xsl:template match="interface">
229                 <xsl:apply-templates select="interface">
230                         <xsl:sort select="@name"/>
231                 </xsl:apply-templates>
232         </xsl:template>
233
234         <xsl:template match="interface[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
235                 <div>
236                         <xsl:call-template name="ELEMENT">
237                                 <xsl:with-param name="class">i</xsl:with-param>
238                         </xsl:call-template>
239                         <xsl:if test="not(@presence)">
240                                 <xsl:apply-templates/>
241                         </xsl:if>
242                 </div>
243         </xsl:template>
244
245
246         <!-- generic constraints -->
247         <xsl:template match="generic-type-constraints">
248                 <xsl:apply-templates select="generic-type-constraint">
249                         <xsl:sort select="@name"/>
250                 </xsl:apply-templates>
251         </xsl:template>
252
253         <xsl:template match="generic-type-constraint[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
254                 <div>
255                         <xsl:call-template name="ELEMENT">
256                                 <xsl:with-param name="class">w</xsl:with-param>
257                         </xsl:call-template>
258                         <xsl:if test="not(@presence)">
259                                 <xsl:apply-templates/>
260                         </xsl:if>
261                 </div>
262         </xsl:template>
263
264
265         <!-- delegate -->
266         <xsl:template match="class[@type='delegate'][@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
267                 <div>
268                         <xsl:call-template name="ELEMENT">
269                                 <xsl:with-param name="class">d</xsl:with-param>
270                         </xsl:call-template>
271                         <xsl:if test="not(@presence)">
272                                 <xsl:apply-templates/>
273                         </xsl:if>
274                 </div>
275         </xsl:template>
276
277
278         <!-- enumeration -->
279         <xsl:template match="class[@type='enum'][@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
280                 <div>
281                         <xsl:call-template name="ELEMENT">
282                                 <xsl:with-param name="class">en</xsl:with-param>
283                         </xsl:call-template>
284                         <xsl:if test="not(@presence)">
285                                 <xsl:apply-templates/>
286                         </xsl:if>
287                 </div>
288         </xsl:template>
289
290
291         <!-- method -->
292         <xsl:template match="methods">
293                 <xsl:apply-templates select="method">
294                         <xsl:sort select="@name"/>
295                 </xsl:apply-templates>
296         </xsl:template>
297
298         <xsl:template match="method[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
299                 <div>
300                         <xsl:call-template name="ELEMENT">
301                                 <xsl:with-param name="class">m</xsl:with-param>
302                         </xsl:call-template>
303                         <xsl:if test="not(@presence)">
304                                 <xsl:apply-templates/>
305                         </xsl:if>
306                 </div>
307         </xsl:template>
308
309
310         <!-- property -->
311         <xsl:template match="properties">
312                 <xsl:apply-templates select="property">
313                         <xsl:sort select="@name"/>
314                 </xsl:apply-templates>
315         </xsl:template>
316
317         <xsl:template match="property[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
318                 <div>
319                         <xsl:call-template name="ELEMENT">
320                                 <xsl:with-param name="class">p</xsl:with-param>
321                         </xsl:call-template>
322                         <xsl:if test="not(@presence)">
323                                 <xsl:apply-templates/>
324                         </xsl:if>
325                 </div>
326         </xsl:template>
327
328
329         <!-- event -->
330         <xsl:template match="events">
331                 <xsl:apply-templates select="event">
332                         <xsl:sort select="@name"/>
333                 </xsl:apply-templates>
334         </xsl:template>
335
336         <xsl:template match="event[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
337                 <div>
338                         <xsl:call-template name="ELEMENT">
339                                 <xsl:with-param name="class">e</xsl:with-param>
340                         </xsl:call-template>
341                         <xsl:if test="not(@presence)">
342                                 <xsl:apply-templates/>
343                         </xsl:if>
344                 </div>
345         </xsl:template>
346
347
348         <!-- constructor -->
349         <xsl:template match="constructors">
350                 <xsl:apply-templates select="constructor">
351                         <xsl:sort select="@name"/>
352                 </xsl:apply-templates>
353         </xsl:template>
354
355         <xsl:template match="constructor[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
356                 <div>
357                         <xsl:call-template name="ELEMENT">
358                                 <xsl:with-param name="class">x</xsl:with-param>
359                                 <xsl:with-param name="image">m</xsl:with-param>
360                         </xsl:call-template>
361                         <xsl:if test="not(@presence)">
362                                 <xsl:apply-templates/>
363                         </xsl:if>
364                 </div>
365         </xsl:template>
366
367
368         <!-- field -->
369         <xsl:template match="fields">
370                 <xsl:apply-templates select="field">
371                         <xsl:sort select="@name"/>
372                 </xsl:apply-templates>
373         </xsl:template>
374
375         <xsl:template match="field[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
376                 <div>
377                         <xsl:call-template name="ELEMENT">
378                                 <xsl:with-param name="class">f</xsl:with-param>
379                         </xsl:call-template>
380                         <xsl:if test="not(@presence)">
381                                 <xsl:apply-templates/>
382                         </xsl:if>
383                 </div>
384         </xsl:template>
385
386         <!-- accessor -->
387         <xsl:template match="property/methods">
388                 <xsl:apply-templates select="method">
389                         <xsl:sort select="@name"/>
390                 </xsl:apply-templates>
391         </xsl:template>
392
393         <xsl:template match="property[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]/methods/method[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
394                 <div>
395                         <xsl:call-template name="ELEMENT">
396                                 <xsl:with-param name="class">o</xsl:with-param>
397                                 <xsl:with-param name="image">m</xsl:with-param>
398                         </xsl:call-template>
399                         <xsl:if test="not(@presence)">
400                                 <xsl:apply-templates/>
401                         </xsl:if>
402                 </div>
403         </xsl:template>
404
405
406         <!-- attribute -->
407         <xsl:template match="attributes">
408                 <xsl:apply-templates select="attribute">
409                         <xsl:sort select="@name"/>
410                 </xsl:apply-templates>
411         </xsl:template>
412
413         <xsl:template match="attribute[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
414                 <div>
415                         <xsl:call-template name="ELEMENT">
416                                 <xsl:with-param name="class">r</xsl:with-param>
417                         </xsl:call-template>
418                         <xsl:if test="not(@presence)">
419                                 <xsl:apply-templates/>
420                         </xsl:if>
421                 </div>
422         </xsl:template>
423
424
425
426         <!-- support templates -->
427
428         <xsl:template name="ELEMENT">
429                 <xsl:param name="class"/>
430                 <xsl:param name="image"/>
431                         <xsl:attribute name="class">
432                                 <xsl:value-of select="$class"/>
433                                 <xsl:if test="./node() and local-name() != 'assembly'">_</xsl:if>
434                         </xsl:attribute>
435                         <xsl:call-template name="toggle"/>
436                         <xsl:choose>
437                                 <xsl:when test="@error and @error != 'todo'">
438                                         <xsl:element name="img">
439                                                 <xsl:attribute name="src">cm/se.gif</xsl:attribute>
440                                                 <xsl:attribute name="class">t</xsl:attribute>
441                                                 <xsl:attribute name="title"><xsl:call-template name="warning-hover" /></xsl:attribute>
442                                         </xsl:element>
443                                 </xsl:when>
444                                 <xsl:when test="@error = 'todo'">
445                                         <xsl:element name="img">
446                                                 <xsl:attribute name="src">cm/st.gif</xsl:attribute>
447                                                 <xsl:attribute name="class">t</xsl:attribute>
448                                                 <xsl:if test="@comment">
449                                                         <xsl:attribute name="title"><xsl:value-of select="@comment"/></xsl:attribute>
450                                                 </xsl:if>
451                                                 <xsl:if test="not(@comment)">
452                                                         <xsl:attribute name="title">No TODO description</xsl:attribute>
453                                                 </xsl:if>
454                                         </xsl:element>
455                                 </xsl:when>
456                                 <xsl:when test="@presence = 'missing'">
457                                         <img src="cm/sm.gif" class="t"/>
458                                 </xsl:when>
459                                 <xsl:when test="@presence = 'extra'">
460                                         <img src="cm/sx.gif" class="t"/>
461                                 </xsl:when>
462                                 <xsl:otherwise>
463                                         <img src="cm/sc.gif" class="t"/>
464                                 </xsl:otherwise>
465                         </xsl:choose>
466                         <xsl:choose>
467                                 <xsl:when test="$image">
468                                         <img src="cm/{$image}.gif" class="t"/>
469                                 </xsl:when>
470                                 <xsl:otherwise>
471                                         <img src="cm/{$class}.gif" class="t"/>
472                                 </xsl:otherwise>
473                         </xsl:choose>
474                         <xsl:call-template name="name"/>
475                         <xsl:if test="not(@presence)">
476                                 <xsl:call-template name="status"/>
477                         </xsl:if>
478         </xsl:template>
479
480         <xsl:template name="status">
481                 <xsl:if test="@complete_total and @complete_total != 0">
482                         <span class="st">
483                                 <img src="cm/sc.gif"/>
484                                 <xsl:text>: </xsl:text>
485                                 <xsl:value-of select="@complete_total"/>
486                                 <xsl:text>%</xsl:text>
487                         </span>
488                 </xsl:if>
489                 <xsl:if test="@todo_total">
490                         <span class="st">
491                                 <img src="cm/st.gif"/>: <xsl:value-of select="@todo_total"/>
492                         </span>
493                 </xsl:if>
494                 <xsl:if test="@missing_total">
495                         <span class="st">
496                                 <img src="cm/sm.gif"/>: <xsl:value-of select="@missing_total"/>
497                         </span>
498                 </xsl:if>
499                 <xsl:if test="@extra_total">
500                         <span class="st">
501                                 <img src="cm/sx.gif"/>: <xsl:value-of select="@extra_total"/>
502                         </span>
503                 </xsl:if>
504                 <xsl:if test="@warning_total">
505                         <span class="st">
506                                 <img src="cm/se.gif"/>: <xsl:value-of select="@warning_total"/>
507                         </span>
508                 </xsl:if>
509         </xsl:template>
510
511         <xsl:template name="toggle">
512                 <xsl:choose>
513                         <xsl:when test="not(@presence) and .//*[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
514                                 <xsl:choose>
515                                         <xsl:when test="local-name() != 'assembly'">
516                                                 <img src="cm/tp.gif" class="t"/>
517                                         </xsl:when>
518                                         <xsl:otherwise>
519                                                 <img src="cm/tm.gif" class="t"/>
520                                         </xsl:otherwise>
521                                 </xsl:choose>
522                         </xsl:when>
523                         <xsl:otherwise>
524                                 <img src="cm/tb.gif"/>
525                         </xsl:otherwise>
526                 </xsl:choose>
527         </xsl:template>
528
529         <xsl:template name="name">
530                 <xsl:if test="@name">
531                         <span class="l"><xsl:value-of select="@name"/></span>
532                 </xsl:if>
533         </xsl:template>
534
535         <xsl:template name="warning-hover">
536                 <xsl:for-each select="warnings/warning">
537                         <xsl:text>WARNING: </xsl:text>
538                         <xsl:value-of select="@text"/>
539                 </xsl:for-each>
540         </xsl:template>
541
542 </xsl:stylesheet>