blob: f60e44ef1dbec12c45e26abd16d3421b66d36b13 [file] [log] [blame]
jeffliu2555d962006-08-02 19:57:46 +00001<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
5 <xsl:template match="/">
6 <html>
7 <script language="javascript">
8 function sort(col)
9 {
10 var table = document.getElementById("data");
11 for (var i = 2; i &lt; table.rows.length; i++)
12 {
13 for (var j = i - 1; j &gt; 0; j--)
14 {
15 var x = parseInt(table.rows[i].cells[col].childNodes[0].data);
16 var y = parseInt(table.rows[j].cells[col].childNodes[0].data);
17 if (x &lt; y)
18 {
19 move(table, i, j + 1);
20 break;
21 }
22 if (j == 1)
23 {
24 move(table, i, 1);
25 break;
26 }
27 }
28 }
29 }
30 function move(table, src, target)
31 {
32 var td_name = document.createElement("td");
33 var td_ref = document.createElement("td");
34
35 td_name.appendChild(document.createTextNode(table.rows[src].cells[0].childNodes[0].data));
36 td_ref.appendChild(document.createTextNode(table.rows[src].cells[1].childNodes[0].data));
37
38 table.deleteRow(src);
39 var tr = table.insertRow(target);
40 tr.appendChild(td_name);
41 tr.appendChild(td_ref);
42 }
43 </script>
44 <body>
45 <table border="0" cellpadding="2" cellspacing="5" width="100%">
46 <tr>
47 <td align="left" width="60%">
48 <font style="font-size: x-large;; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold">
49 API Usage Report
50 </font>
51 </td>
52 </tr>
53 </table>
54 <table border="0" cellpadding="2" cellspacing="5" width="100%">
55 <tr>
56 <td ALIGN="LEFT" VALIGN="TOP" COLSPAN="2" BGCOLOR="#0080C0"><b><font color="#FFFFFF" face="Arial,Helvetica">
57 API usage summary
58 </font></b></td>
59 </tr>
60 </table>
jeffliuf49d3072006-08-09 19:33:20 +000061 <!--
jeffliu2555d962006-08-02 19:57:46 +000062 <br/>
63 <p>
64 Sort by:
65 <select name="sortby" onchange="javascript:sort(this.selectedIndex)">
66 <option value="0">Class name</option>
67 <option value="1">Reference count</option>
68 </select>
69 </p>
jeffliuf49d3072006-08-09 19:33:20 +000070 -->
71 <xsl:for-each select="root/team">
72 <xsl:sort select="@lead"/>
73 <xsl:apply-templates select="."/>
74 </xsl:for-each>
jeffliu2555d962006-08-02 19:57:46 +000075 </body>
76 </html>
77 </xsl:template>
78
jeffliuf49d3072006-08-09 19:33:20 +000079 <xsl:template match="team">
80 <h2><xsl:value-of select="@lead"/></h2>
81 <table id="data" border="1" width="80%">
82 <tr>
83 <th width="95%">Class name</th>
84 <th>Reference count</th>
85 </tr>
86 <xsl:for-each select="class">
87 <xsl:sort select="@name"/>
88 <xsl:apply-templates select="."/>
89 </xsl:for-each>
90 </table>
91 </xsl:template>
92
93 <xsl:template match="class">
94 <tr>
95 <td><xsl:value-of select="@name"/></td>
96 <td><xsl:value-of select="@ref"/></td>
97 </tr>
98 </xsl:template>
99
jeffliu2555d962006-08-02 19:57:46 +0000100</xsl:stylesheet>