Anonymous - 2010-10-26

The following xslt file will convert an EMMA report to CSV:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="/report/data/all/package/srcfile/class/method/coverage">
<xsl:if test="starts-with(@type, 'method')">
<xsl:text>"</xsl:text>
<xsl:value-of select="../../../../@name" />
<xsl:text>","</xsl:text>
<xsl:value-of select="../../@name" />
<xsl:text>","</xsl:text>
<xsl:value-of select="../@name" />
<xsl:text>","</xsl:text>
<xsl:value-of select="@value" />
<xsl:text>"&#xa;</xsl:text>
</xsl:if>       
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Run it using xsltproc