]> matita.cs.unibo.it Git - helm.git/blob - helm/papers/use_case/stats/mkhtml.xsl
ocaml 3.09 transition
[helm.git] / helm / papers / use_case / stats / mkhtml.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <xsl:stylesheet version="1.0"
4                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5                  xmlns:html="http://www.w3.org/1999/xhtml"
6                  xmlns:xlink="http://www.w3.org/1999/xlink"
7                  xmlns:m="http://www.w3.org/1998/Math/MathML"
8                  xmlns:box="http://helm.cs.unibo.it/2003/BoxML"
9 >
10
11 <xsl:template match="/">
12   <html>
13     <body>
14       <table border="1">
15         <tr>
16           <th>N</th>
17           <th>Size (bytes)</th>
18           <th>Elements</th>
19           <th>Max depth</th>
20           <!--
21           <th>Text nodes</th>
22           <th>Total nodes</th>
23           <th>Leaf avg</th>
24           <th>Max width</th>
25           <th>Inner avg width</th>
26           <th>Max attributes</th>
27           <th>Total attributes</th>
28           -->
29           <th>Object</th>
30         </tr>
31         <xsl:apply-templates select="statistics/stats">
32           <xsl:sort order="descending" data-type="number" select="number(elements/total)"/>
33         </xsl:apply-templates>
34       </table>
35     </body>
36   </html>  
37 </xsl:template>
38
39 <xsl:template match="stats">
40   <tr>
41     <td align="left">
42       <xsl:value-of select="position()"/>
43     </td>
44     <td align="left">
45       <xsl:value-of select="size"/>
46     </td>
47     <td align="left">
48       <xsl:value-of select="number(elements/total)"/>
49     </td>
50     <td align="left">
51       <xsl:value-of select="depth/max"/>
52     </td>
53     <!--
54     <td align="left">
55       <xsl:value-of select="number(text-nodes/total)"/>
56     </td>
57     <td align="left">
58       <xsl:value-of select="number(elements/total) + number(text-nodes/total)"/>
59     </td>
60     <td align="left">
61       <xsl:value-of select="round(depth/leaf-avg)"/>
62     </td>
63     <td align="left">
64       <xsl:value-of select="width/max"/>
65     </td>
66     <td align="left">
67       <xsl:value-of select="round(width/inner-avg)"/>
68     </td>
69     <td align="left">
70       <xsl:value-of select="attributes/max"/>
71     </td>
72     <td align="left">
73       <xsl:value-of select="attributes/total"/>
74     </td>
75     -->
76     <th align="left">
77       <xsl:value-of select="@for"/>
78     </th>
79   </tr>
80 </xsl:template>
81
82 </xsl:stylesheet>
83