473,378 Members | 1,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

sum codecoverage values for different groups

Hi,

In my xml file I have code coverage data ( see below).

Right below I have the xslt that I use to create a new html report.

I the new report I will show codecoverage for the 'fpx', 'main' and
'common' java packages ( group of packages containing the name in the
whole java package name).

How can I extract the attribute 'value' value for element 'coverage'
where attribute 'type' is "block, %". Then I need to calculate the
value for all packages containing fpx in package name ( that is why I
use <xsl:chosse> and <xsl:when>). Is it possible?

All hints are very much welcome!

cheers,

//mikael

xslt
----

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<!-- Main -->
<xsl:template match="/">

<html><body>
<xsl:for-each select="report/data/all/package">
<xsl:sort select="@name" order="descending" data-type="text"/>
<tr>
<xsl:choose>
<xsl:when
test='contains(@name,"se.company.product.subsys.bo am.fpx")'>
<xsl:call-template name="calc">
<xsl:with-param name="measure" select="../coverage[@value]"/>
</xsl:call-template>
</xsl:when>
<xsl:when
test='contains(@name,"se.company.product.subsys.bo am.main")'>
<!-- No impl yet -->
</xsl:when>
<xsl:when
test='contains(@name,"se.company.product.subsys.bo am.common")'>
<!-- No impl yet -->
</xsl:when>
<xsl:otherwise>

</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:for-each>
</body></html>
</xsl:template>

<xsl:template name="calc">
<xsl:param name="measure"/>
<td> <xsl:value-of select="$measure"/></td>
</xsl:template>
</xsl:stylesheet>


code coverage data
------------------

<?xml version="1.0" encoding="UTF-8"?><!-- EMMA v2.0.4217 report,
generated Fri Aug 26 09:24:18 MEST 2005 -->

<report>
<stats>
<packages value="44"/>
<classes value="1371"/>
<methods value="8293"/>
<srcfiles value="1356"/>
<srclines value="59524"/>
</stats>
<data>
<all name="all classes">
<coverage type="class, %" value="65% (892/1371)"/>
<coverage type="method, %" value="58% (4789/8293)"/>
<coverage type="block, %" value="53% (146231/274917)"/>
<coverage type="line, %" value="52% (31092.2/59524)"/>

<package name="se.company.product.subsys.boam.fpx.testsigna ls">
<coverage type="class, %" value="0% (0/2)"/>
<coverage type="method, %" value="0% (0/9)"/>
<coverage type="block, %" value="0% (0/61)"/>
<coverage type="line, %" value="0% (0/27)"/>
</package>
<package
name="se.company.product.subsys.boam.mao.dmo.auxde vice.tb.mock">
<coverage type="class, %" value="0% (0/1)"/>
<coverage type="method, %" value="0% (0/10)"/>
<coverage type="block, %" value="0% (0/51)"/>
<coverage type="line, %" value="0% (0/16)"/>
</package>
<package name="se.company.product.subsys.boam.mao.iface.enu m">
Aug 31 '05 #1
0 875

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: sqlservernewbie | last post by:
Hi Everyone, Here is a theoretical, and definition question for you. In databases, we have: Relation a table with columns and rows
11
by: sqlservernewbie | last post by:
Hi Everyone, Here is a theoretical, and definition question for you. In databases, we have: Relation a table with columns and rows
43
by: emyl | last post by:
Hi all, here's an elementary question. Assume I have declared two variables, char *a, **b; I can then give a value to a like a="hello world";
3
by: ravideep | last post by:
if I set the website layout in pixels, say 800X600. It works fine with screens with window size 800X600. But if someone is having screen 1200X800, then it doesn't stretch to the full window. How can...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.