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>"
</xsl:text> </xsl:if> </xsl:for-each> </xsl:template> </xsl:stylesheet>
Run it using xsltproc
Log in to post a comment.
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>"
</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Run it using xsltproc