]> matita.cs.unibo.it Git - helm.git/commitdiff
* added stylesheet to render the results
authorLuca Padovani <luca.padovani@unito.it>
Tue, 9 Nov 2004 08:22:37 +0000 (08:22 +0000)
committerLuca Padovani <luca.padovani@unito.it>
Tue, 9 Nov 2004 08:22:37 +0000 (08:22 +0000)
helm/papers/use_case/stats/mkhtml.xsl [new file with mode: 0644]

diff --git a/helm/papers/use_case/stats/mkhtml.xsl b/helm/papers/use_case/stats/mkhtml.xsl
new file mode 100644 (file)
index 0000000..643d485
--- /dev/null
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsl:stylesheet version="1.0"
+                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:html="http://www.w3.org/1999/xhtml"
+                xmlns:xlink="http://www.w3.org/1999/xlink"
+                xmlns:m="http://www.w3.org/1998/Math/MathML"
+                xmlns:box="http://helm.cs.unibo.it/2003/BoxML"
+>
+
+<xsl:template match="/">
+  <html>
+    <body>
+      <table border="1">
+        <tr>
+         <th>N</th>
+         <th>Nodes</th>
+         <th>Inner nodes/Leaf elements/Text nodes</th>
+         <th>Depth (max/leaf avg)</th>
+         <th>Width (max/inner avg)</th>
+         <th>Attributes (max/total)</th>
+         <th>Object</th>
+       </tr>
+        <xsl:apply-templates select="statistics/stats">
+         <xsl:sort order="descending" data-type="number" select="number(elements/total) + number(text-nodes/total)"/>
+       </xsl:apply-templates>
+      </table>
+    </body>
+  </html>  
+</xsl:template>
+
+<xsl:template match="stats">
+  <tr>
+    <td align="left">
+      <xsl:value-of select="position()"/>
+    </td>
+    <td align="left">
+      <xsl:value-of select="number(elements/total) + number(text-nodes/total)"/>
+    </td>
+    <td align="left">
+      <xsl:value-of select="number(elements/total) - number(elements/leaf)"/>
+      <xsl:text>/</xsl:text>
+      <xsl:value-of select="number(elements/leaf)"/>
+      <xsl:text>/</xsl:text>
+      <xsl:value-of select="number(text-nodes/total)"/>
+    </td>
+    <td align="left">
+      <xsl:value-of select="depth/max"/>
+      <xsl:text>/</xsl:text>
+      <xsl:value-of select="depth/leaf-avg"/>
+    </td>
+    <td align="left">
+      <xsl:value-of select="width/max"/>
+      <xsl:text>/</xsl:text>
+      <xsl:value-of select="width/inner-avg"/>
+    </td>
+    <td align="left">
+      <xsl:value-of select="attributes/max"/>
+      <xsl:text>/</xsl:text>
+      <xsl:value-of select="attributes/total"/>
+    </td>
+    <th align="left">
+      <xsl:value-of select="@for"/>
+    </th>
+  </tr>
+</xsl:template>
+
+</xsl:stylesheet>
+