Skip to end of metadata
Go to start of metadata
All Versions
Clover 2.5 Documentation

Using XPath with Clover's XML reports

Clover's XML reports provide detailed coverage data in a format that is easy to access programmatically using XPath. XML coverage reports can be generated by the <clover-report> or <clover-historypoint> Ant tasks. The following example XPath expressions show how to extract data from a Clover XML coverage report:

The above statement extracts the total number of statements in the project.

The above extracts the total number of covered statements in the project.

The above extracts the total number of statements in the package com.foo.bar.

The above extracts the total number of covered statements in the package com.foo.bar.

An XPath implementation is shipped with the JDK1.5 distribution. Third party implementations that work with JDK1.4 and below include Jaxen, Dom4j and JXP.

The following code example (using the JDK1.5 implementation of XPath) demonstrates simple extraction of coverage data from a Clover XML report: import javax.xml.xpath.*;



Log a request with our support team.



Raise an issue for our developers.



See answers from the community.



Tweet, blog and update our documentation.

Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 2.5 Australia License.