]> matita.cs.unibo.it Git - helm.git/blob - helm/papers/use_case/stats/groups_dependent_size.xsl
ocaml 3.09 transition
[helm.git] / helm / papers / use_case / stats / groups_dependent_size.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:param name="size_min" select="1"/>
12 <xsl:param name="size_max" select="200"/>
13 <xsl:param name="perc" select="0.03"/>
14 <xsl:param name="step" select="10"/>
15
16 <xsl:template match="/">
17   <html>
18     <body>
19       <xsl:call-template name="find-dep"/>
20     </body>
21   </html>  
22 </xsl:template>
23
24 <xsl:template name="find-dep">
25   <xsl:param name="size" select="$size_min"/>
26   <xsl:variable name="range" select="$size * $perc"/>
27   <xsl:if test="$size &lt;= $size_max">
28     <table border="1">
29       <tr>
30         <th>N</th>
31           <th>Size (bytes)</th>
32           <th>Elements</th>
33           <th>Max depth</th>
34           <!--
35           <th>Text nodes</th>
36           <th>Total nodes</th>
37           <th>Leaf avg</th>
38           <th>Max width</th>
39           <th>Inner avg width</th>
40           <th>Max attributes</th>
41           <th>Total attributes</th>
42           -->
43           <th>Object</th>
44         </tr>
45       <xsl:apply-templates select="statistics/stats[number(depth/max) &gt;= $size - $range
46                                                     and number(depth/max) &lt;= $size + $range]">
47         <xsl:sort order="ascending" data-type="number" select="number(elements/total)"/>
48       </xsl:apply-templates>
49     </table>
50     <xsl:call-template name="find-dep">
51       <xsl:with-param name="size" select="$size + $step"/>
52     </xsl:call-template>
53   </xsl:if>
54 </xsl:template>
55
56 <xsl:template match="stats">
57   <tr>
58     <td align="left">
59       <xsl:value-of select="position()"/>
60     </td>
61     <td align="left">
62       <xsl:value-of select="size"/>
63     </td>
64     <td align="left">
65       <xsl:value-of select="number(elements/total)"/>
66     </td>
67     <td align="left">
68       <xsl:value-of select="depth/max"/>
69     </td>
70     <!--
71     <td align="left">
72       <xsl:value-of select="number(text-nodes/total)"/>
73     </td>
74     <td align="left">
75       <xsl:value-of select="number(elements/total) + number(text-nodes/total)"/>
76     </td>
77     <td align="left">
78       <xsl:value-of select="round(depth/leaf-avg)"/>
79     </td>
80     <td align="left">
81       <xsl:value-of select="width/max"/>
82     </td>
83     <td align="left">
84       <xsl:value-of select="round(width/inner-avg)"/>
85     </td>
86     <td align="left">
87       <xsl:value-of select="attributes/max"/>
88     </td>
89     <td align="left">
90       <xsl:value-of select="attributes/total"/>
91     </td>
92     -->
93     <th align="left">
94       <xsl:value-of select="substring(@for,21)"/>
95     </th>
96   </tr>
97 </xsl:template>
98
99 </xsl:stylesheet>
100