]> matita.cs.unibo.it Git - helm.git/blob - helm/papers/use_case/stats/mkhtml.xsl
* added stylesheet to render the results
[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>Nodes</th>
18           <th>Inner nodes/Leaf elements/Text nodes</th>
19           <th>Depth (max/leaf avg)</th>
20           <th>Width (max/inner avg)</th>
21           <th>Attributes (max/total)</th>
22           <th>Object</th>
23         </tr>
24         <xsl:apply-templates select="statistics/stats">
25           <xsl:sort order="descending" data-type="number" select="number(elements/total) + number(text-nodes/total)"/>
26         </xsl:apply-templates>
27       </table>
28     </body>
29   </html>  
30 </xsl:template>
31
32 <xsl:template match="stats">
33   <tr>
34     <td align="left">
35       <xsl:value-of select="position()"/>
36     </td>
37     <td align="left">
38       <xsl:value-of select="number(elements/total) + number(text-nodes/total)"/>
39     </td>
40     <td align="left">
41       <xsl:value-of select="number(elements/total) - number(elements/leaf)"/>
42       <xsl:text>/</xsl:text>
43       <xsl:value-of select="number(elements/leaf)"/>
44       <xsl:text>/</xsl:text>
45       <xsl:value-of select="number(text-nodes/total)"/>
46     </td>
47     <td align="left">
48       <xsl:value-of select="depth/max"/>
49       <xsl:text>/</xsl:text>
50       <xsl:value-of select="depth/leaf-avg"/>
51     </td>
52     <td align="left">
53       <xsl:value-of select="width/max"/>
54       <xsl:text>/</xsl:text>
55       <xsl:value-of select="width/inner-avg"/>
56     </td>
57     <td align="left">
58       <xsl:value-of select="attributes/max"/>
59       <xsl:text>/</xsl:text>
60       <xsl:value-of select="attributes/total"/>
61     </td>
62     <th align="left">
63       <xsl:value-of select="@for"/>
64     </th>
65   </tr>
66 </xsl:template>
67
68 </xsl:stylesheet>
69