473,396 Members | 1,927 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,396 software developers and data experts.

Count matching packages

How can I count all java packages that contains fpx in their name using
xslt?

cheers,

//mikael

I have the following data:

<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>
......................
Aug 31 '05 #1
6 1359
Tempore 12:47:01, die Wednesday 31 August 2005 AD, hinc in foro {comp.text.xml} scripsit Petterson Mikael <mi**************@era.ericsson.se>:
How can I count all java packages that contains fpx in their name using
xslt?


count(/report/data/all/package[contains(@name,'fpx')])

--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
«Numquam mores quos extuli refero» - Seneca , Ad Lucilium I, 7
Aug 31 '05 #2
Joris Gillis wrote:
Tempore 12:47:01, die Wednesday 31 August 2005 AD, hinc in foro
{comp.text.xml} scripsit Petterson Mikael
<mi**************@era.ericsson.se>:
How can I count all java packages that contains fpx in their name using
xslt?

count(/report/data/all/package[contains(@name,'fpx')])


Thanks that worked fine!

Two more questions:

How can I get the value ( percentage e.g. 65%) of attribute value for
element coverage?

When shall I use [ ] ?

cheers,

//mikael

I have the following data:

<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>
......................
Aug 31 '05 #3
Petterson Mikael wrote:
Joris Gillis wrote:
Tempore 12:47:01, die Wednesday 31 August 2005 AD, hinc in foro
{comp.text.xml} scripsit Petterson Mikael
<mi**************@era.ericsson.se>:
How can I count all java packages that contains fpx in their name using
xslt?


count(/report/data/all/package[contains(@name,'fpx')])


Thanks that worked fine!

Two more questions:

How can I get the value ( percentage e.g. 65%) of attribute value for
element coverage?

When shall I use [ ] ?

cheers,

//mikael

I have the following data:

<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>
.....................

I have tried the following Xpath expression:

/report/data/all/package/coverage[@type='block, %']/@value

Then I get "all" values for attribute value.
I need to get one/two/three digits e g. 5% or 24% or 100%. Is it
possible to do this?

cheers,

//mikael
Aug 31 '05 #4
Petterson Mikael wrote:
Petterson Mikael wrote:
Joris Gillis wrote:
Tempore 12:47:01, die Wednesday 31 August 2005 AD, hinc in foro
{comp.text.xml} scripsit Petterson Mikael
<mi**************@era.ericsson.se>:

How can I count all java packages that contains fpx in their name using
xslt?


count(/report/data/all/package[contains(@name,'fpx')])


Thanks that worked fine!

Two more questions:

How can I get the value ( percentage e.g. 65%) of attribute value for
element coverage?

When shall I use [ ] ?

cheers,

//mikael

I have the following data:

<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>
.....................


I have tried the following Xpath expression:

/report/data/all/package/coverage[@type='block, %']/@value

Then I get "all" values for attribute value.
I need to get one/two/three digits e g. 5% or 24% or 100%. Is it
possible to do this?

cheers,

//mikael


Hi,

I thought of using:

substring-before(@value,'%') but don't know how to add it to the xpath
expression.

All help is appreciated!

cheers,

//mikael
Aug 31 '05 #5
> substring-before(@value,'%') but don't know how to add it to the xpath
expression.


substring-before(/report/data/all/package/coverage[@type='block, %']/@value,'%') ?
Aug 31 '05 #6
Joris Gillis wrote:
substring-before(@value,'%') but don't know how to add it to the xpath
expression.

substring-before(/report/data/all/package/coverage[@type='block,
%']/@value,'%') ?


Hmmm....

I can't get this to work. My Xpath explorer is returning 0.
Any idea why?

//mikael
Sep 1 '05 #7

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

Similar topics

2
by: Anthony Robinson | last post by:
Is there any way to do multiple select count(*) statements in a SQL query. I have a table that I want to get the counts of rows matching certain criteria. For example: SELECT COUNT(1) AS...
4
by: vacataire testeur de site web | last post by:
Bonjour je cherche à afficher de count de tables identiques dans la forme exemple num_cli | nombre de poste | nombre de voiture 1 1 3 2 2 ...
2
by: Michael Howes | last post by:
I have a single DataTable in a DataSet. It has 4 columns and i'd like to get a handful of counts of unique items in 3 of the 4 columns. Can a DataTables Select or Compute methods to COUNT DISTINCT?...
0
by: Peter Rilling | last post by:
I am working on trying to compare "titles" from two different lists and trying to determine the most likely match. When a similar entry appears in both, the result works well, but what I need to...
20
by: Serge Rielau | last post by:
I'm playing with the ICU library (slow weekend :-) and it's quite simple to expose the regular expression functionality for Unicode databases. Presuming that the majority is not on unicode, would...
22
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source="...
2
by: jonathan184 | last post by:
Hi I am having a problme where the results of the sql count is not matching the results of the perl script sql count. The script was working fine up till Wed last week and after that the results...
29
by: n00m | last post by:
http://www.spoj.pl/problems/SUMFOUR/ 3 0 0 0 0 0 0 0 0 -1 -1 1 1 Answer for this input data is 33. My solution for the problem is...
7
by: blaine | last post by:
Hey everyone, For the regular expression gurus... I'm trying to write a string matching algorithm for genomic sequences. I'm pulling out Genes from a large genomic pattern, with certain start...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.