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