xsl/html-transformer.xslt

<!-- $Id: html-transformer.xslt.html 241 2004-12-15 16:22:42Z bkarak $ --> 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
    <xsl:output method="html" /> 
 
    <!-- main transformation --> 
    <xsl:template match="benchmark"> 
<html> 
 <head> 
     <title>Benchmarking results of <xsl:value-of select="current()/xml-file" /></title> 
 </head> 
 <body> 
<h1>Benchmark Results</h1> 
 
Produced by Benchmark Utility<br /> 
Created by:<br /> 
Vassilios Karakoidas (bkarak@aueb.gr) - http://istlab.dmst.aueb.gr/~bkarak/<br /> 
Diomidis Spinellis (dds@aueb.gr) - http://www.spinellis.gr/<br /> 
<br /> 
<b>XML File: </b><xsl:value-of select="current()/xml-file" /><br /> 
 
<h3>Iteration Benchmarks</h3> 
<table border="1"> 
<xsl:apply-templates select="current()/iteration-result" /> 
</table> 
 
<h3>Compatibility Tests</h3> 
<table border="1"> 
<xsl:apply-templates select="current()/compatibility-result/engine-list" /> 
<xsl:apply-templates select="current()/compatibility-result/data-set" /> 
</table> 
 </body> 
</html> 
    </xsl:template> 
 
    <!-- compatibility --> 
    <xsl:template match="data-set"> 
        <tr> 
        <td> 
            Regex: <b><xsl:value-of select="current()/regex" /></b><br /> 
            Data: <b><xsl:value-of select="current()/data" /></b> 
        </td> 
        <xsl:apply-templates select="current()/compatible" /> 
        </tr> 
    </xsl:template> 
 
    <xsl:template match="compatible"> 
        <td><xsl:value-of select="current()" /></td> 
    </xsl:template> 
 
    <xsl:template match="engine-list"> 
        <tr> 
            <td>Regular Expression / Data</td> 
            <xsl:apply-templates select="current()/engine" /> 
        </tr> 
    </xsl:template> 
 
    <xsl:template match="engine"> 
        <td><b><xsl:value-of select="current()" /></b></td> 
    </xsl:template> 
 
    <!-- transform iteration --> 
    <xsl:template match="iteration-result"> 
    <tr> 
        <td><b>Regular Expression:</b> <xsl:value-of select="current()/regex" /></td> 
        <td><b>Data:</b> <xsl:value-of select="current()/data" /></td> 
    </tr> 
    <xsl:apply-templates select="current()/engine" mode="iteration" /> 
    </xsl:template> 
 
    <xsl:template match="engine" mode="iteration"> 
    <tr> 
<td colspan="2"><xsl:value-of select="name" /> - <xsl:value-of select="time" />  msecs</td> 
    </tr> 
    </xsl:template> 
 
</xsl:stylesheet>