Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- xsl by Frank Sauer
- from http://sourceforge.net/forum/message.php?msg_id=2041225
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://metrics.sourceforge.net/2003/Metrics-First-Flat">
- <xsl:output omit-xml-declaration="yes" media-type="text/html" indent="yes" method="html"/>
- <xsl:template match="/m:Metrics">
- <html>
- <head>
- <title>Metrics Report for <xsl:value-of select="@type"/> <xsl:value-of select="@scope"/></title>
- </head>
- <body>
- <h1>Metrics Report for <xsl:value-of select="@scope"/> (<xsl:value-of select="@type"/>)</h1>
- <xsl:apply-templates/>
- </body>
- </html>
- </xsl:template>
- <xsl:template match="m:Metric">
- <h2><xsl:value-of select="@description"/> (<xsl:value-of select="@id"/>)</h2>
- <xsl:apply-templates/>
- </xsl:template>
- <xsl:template match="m:Values">
- <p>Average per <xsl:value-of select="@per"/> is <xsl:value-of select="@avg"/></p>
- <p>Standard Deviation is <xsl:value-of select="@stddev"/></p>
- <p>Maximum value is <xsl:value-of select="@max"/></p>
- <table border="1">
- <tbody>
- <tr>
- <th><xsl:value-of select="@per"/></th>
- <xsl:if test="m:Value/@source">
- <th>file</th>
- </xsl:if>
- <th>package</th><th>value</th>
- </tr>
- <xsl:apply-templates mode="multiple"/>
- </tbody>
- </table>
- </xsl:template>
- <xsl:template match="m:Value" mode="multiple">
- <tr>
- <td><xsl:value-of select="@name"/></td>
- <xsl:if test="@source"><td><xsl:value-of select="@source"/></td></xsl:if>
- <td><xsl:value-of select="@package"/></td><td><xsl:value-of select="@value"/></td>
- </tr>
- </xsl:template>
- <xsl:template match="m:Value">
- <p>Value: <xsl:value-of select="@value"/></p>
- </xsl:template>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement