CoverageReport.xsl 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
  2. <!-- Created for NCoverExplorer by Grant Drake (see http://www.kiwidude.com/blog/) -->
  3. <xsl:output method="html" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
  4. <xsl:template match="/">
  5. <html>
  6. <head>
  7. <xsl:comment>Generated by NCoverExplorer (see http://www.kiwidude.com/blog/)</xsl:comment>
  8. <title>NCoverExplorer - Merged Report</title>
  9. <style>
  10. body { font: small verdana, arial, helvetica; color:#000000; }
  11. .coverageReportTable { font-size: 9px; }
  12. .reportHeader { padding: 5px 8px 5px 8px; font-size: 12px; border: 1px solid; margin: 0px; }
  13. .titleText { font-weight: bold; font-size: 12px; white-space: nowrap; padding: 0px; margin: 1px; }
  14. .subtitleText { font-size: 9px; font-weight: normal; padding: 0px; margin: 1px; white-space: nowrap; }
  15. .projectStatistics { font-size: 10px; border-left: #649cc0 1px solid; white-space: nowrap; width: 40%; }
  16. .heading { font-weight: bold; }
  17. .mainTableHeaderLeft { border: #dcdcdc 1px solid; font-weight: bold; padding-left: 5px; }
  18. .mainTableHeader { border-bottom: 1px solid; border-top: 1px solid; border-right: 1px solid; text-align: center; }
  19. .mainTableGraphHeader { border-bottom: 1px solid; border-top: 1px solid; border-right: 1px solid; text-align: left; font-weight: bold; }
  20. .mainTableCellItem { background: #ffffff; border-left: #dcdcdc 1px solid; border-right: #dcdcdc 1px solid; padding-left: 10px; padding-right: 10px; font-weight: bold; font-size: 10px; }
  21. .mainTableCellData { background: #ffffff; border-right: #dcdcdc 1px solid; text-align: center; white-space: nowrap; }
  22. .mainTableCellPercent { background: #ffffff; font-weight: bold; white-space: nowrap; text-align: right; padding-left: 10px; }
  23. .mainTableCellGraph { background: #ffffff; border-right: #dcdcdc 1px solid; padding-right: 5px; }
  24. .mainTableCellBottom { border-bottom: #dcdcdc 1px solid; }
  25. .childTableHeader { border-top: 1px solid; border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; font-weight: bold; padding-left: 10px; }
  26. .childTableCellIndentedItem { background: #ffffff; border-left: #dcdcdc 1px solid; border-right: #dcdcdc 1px solid; padding-right: 10px; font-size: 10px; }
  27. .exclusionTableCellItem { background: #ffffff; border-left: #dcdcdc 1px solid; border-right: #dcdcdc 1px solid; padding-left: 10px; padding-right: 10px; }
  28. .projectTable { background: #a9d9f7; border-color: #649cc0; }
  29. .primaryTable { background: #d7eefd; border-color: #a4dafc; }
  30. .secondaryTable { background: #f9e9b7; border-color: #f6d376; }
  31. .secondaryChildTable { background: #fff6df; border-color: #f5e1b1; }
  32. .exclusionTable { background: #fadada; border-color: #f37f7f; }
  33. .graphBarNotVisited { font-size: 2px; border:#9c9c9c 1px solid; background:#df0000; }
  34. .graphBarSatisfactory { font-size: 2px; border:#9c9c9c 1px solid; background:#f4f24e; }
  35. .graphBarVisited { background: #00df00; font-size: 2px; border-left:#9c9c9c 1px solid; border-top:#9c9c9c 1px solid; border-bottom:#9c9c9c 1px solid; }
  36. .graphBarVisitedFully { background: #00df00; font-size: 2px; border:#9c9c9c 1px solid; }
  37. </style>
  38. </head>
  39. <body>
  40. <table class="coverageReportTable" cellpadding="2" cellspacing="0">
  41. <tbody>
  42. <xsl:apply-templates select="//coverageReport" />
  43. </tbody>
  44. </table>
  45. </body>
  46. </html>
  47. </xsl:template>
  48. <!-- Main Project Section -->
  49. <xsl:template match="//coverageReport">
  50. <xsl:variable name="reportType" select="./@reportTitle" />
  51. <xsl:variable name="threshold">
  52. <xsl:choose>
  53. <xsl:when test="$reportType = 'Module Class Function Summary'"><xsl:value-of select="./project/@acceptableFunction" /></xsl:when>
  54. <xsl:otherwise><xsl:value-of select="./project/@acceptable" /></xsl:otherwise>
  55. </xsl:choose>
  56. </xsl:variable>
  57. <xsl:variable name="unvisitedTitle">
  58. <xsl:choose>
  59. <xsl:when test="$reportType = 'Module Class Function Summary'">Unvisited Functions</xsl:when>
  60. <xsl:otherwise>Unvisited SeqPts</xsl:otherwise>
  61. </xsl:choose>
  62. </xsl:variable>
  63. <xsl:variable name="coverageTitle">
  64. <xsl:choose>
  65. <xsl:when test="$reportType = 'Module Class Function Summary'">Function Coverage</xsl:when>
  66. <xsl:otherwise>Coverage</xsl:otherwise>
  67. </xsl:choose>
  68. </xsl:variable>
  69. <xsl:call-template name="header" />
  70. <xsl:call-template name="projectSummary">
  71. <xsl:with-param name="threshold" select="$threshold" />
  72. <xsl:with-param name="unvisitedTitle" select="$unvisitedTitle" />
  73. <xsl:with-param name="coverageTitle" select="$coverageTitle" />
  74. <xsl:with-param name="reportType" select="$reportType" />
  75. </xsl:call-template>
  76. <xsl:call-template name="moduleSummary">
  77. <xsl:with-param name="threshold" select="$threshold" />
  78. <xsl:with-param name="unvisitedTitle" select="$unvisitedTitle" />
  79. <xsl:with-param name="coverageTitle" select="$coverageTitle" />
  80. </xsl:call-template>
  81. <xsl:if test="$reportType = 'Module Namespace Summary'">
  82. <xsl:call-template name="moduleNamespaceSummary">
  83. <xsl:with-param name="threshold" select="$threshold" />
  84. </xsl:call-template>
  85. </xsl:if>
  86. <xsl:if test="($reportType = 'Module Class Summary') or ($reportType = 'Module Class Function Summary')">
  87. <xsl:call-template name="classModuleSummary">
  88. <xsl:with-param name="threshold" select="$threshold" />
  89. <xsl:with-param name="unvisitedTitle" select="$unvisitedTitle" />
  90. <xsl:with-param name="coverageTitle" select="$coverageTitle" />
  91. </xsl:call-template>
  92. </xsl:if>
  93. <xsl:if test="count(./exclusions/exclusion) != 0">
  94. <xsl:call-template name="exclusionsSummary" />
  95. </xsl:if>
  96. <xsl:call-template name="footer" />
  97. </xsl:template>
  98. <!-- Report Header -->
  99. <xsl:template name="header">
  100. <tr>
  101. <td class="projectTable reportHeader" colspan="5">
  102. <table width="100%">
  103. <tbody>
  104. <tr>
  105. <td valign="top">
  106. <h1 class="titleText">NCoverExplorer Coverage Report - <xsl:value-of select="./project/@name" />&#160;&#160;</h1>
  107. <table cellpadding="1" class="subtitleText">
  108. <tbody>
  109. <tr>
  110. <td class="heading">Report generated on:</td>
  111. <td><xsl:value-of select="./@date" />&#160;at&#160;<xsl:value-of select="./@time" /></td>
  112. </tr>
  113. <tr>
  114. <td class="heading">NCoverExplorer version:</td>
  115. <td><xsl:value-of select="./@version" /></td>
  116. </tr>
  117. <tr>
  118. <td class="heading">Filtering / Sorting:</td>
  119. <td><xsl:value-of select="./project/@filteredBy" />&#160;/&#160;<xsl:value-of select="./project/@sortedBy" /></td>
  120. </tr>
  121. </tbody>
  122. </table>
  123. </td>
  124. <td class="projectStatistics" align="right" valign="top">
  125. <table cellpadding="1">
  126. <tbody>
  127. <tr>
  128. <td rowspan="4" valign="top" nowrap="true" class="heading">Project Statistics:</td>
  129. <td align="right" class="heading">Files:</td>
  130. <td align="right"><xsl:value-of select="./project/@files" /></td>
  131. <td rowspan="4">&#160;</td>
  132. <td align="right" class="heading">NCLOC:</td>
  133. <td align="right"><xsl:value-of select="./project/@nonCommentLines" /></td>
  134. </tr>
  135. <tr>
  136. <td align="right" class="heading">Classes:</td>
  137. <td align="right"><xsl:value-of select="./project/@classes" /></td>
  138. <td align="right" class="heading">&#160;</td>
  139. <td align="right">&#160;</td>
  140. </tr>
  141. <tr>
  142. <td align="right" class="heading">Functions:</td>
  143. <td align="right"><xsl:value-of select="./project/@members" /></td>
  144. <td align="right" class="heading">Unvisited:</td>
  145. <td align="right"><xsl:value-of select="./project/@unvisitedFunctions" /></td>
  146. </tr>
  147. <tr>
  148. <td align="right" class="heading">Seq Pts:</td>
  149. <td align="right"><xsl:value-of select="./project/@sequencePoints" /></td>
  150. <td align="right" class="heading">Unvisited:</td>
  151. <td align="right"><xsl:value-of select="./project/@unvisitedPoints" /></td>
  152. </tr>
  153. </tbody>
  154. </table>
  155. </td>
  156. </tr>
  157. </tbody>
  158. </table>
  159. </td>
  160. </tr>
  161. </xsl:template>
  162. <!-- Project Summary -->
  163. <xsl:template name="projectSummary">
  164. <xsl:param name="threshold" />
  165. <xsl:param name="unvisitedTitle" />
  166. <xsl:param name="coverageTitle" />
  167. <xsl:param name="reportType" />
  168. <tr>
  169. <td colspan="5">&#160;</td>
  170. </tr>
  171. <tr>
  172. <td class="projectTable mainTableHeaderLeft">Project</td>
  173. <td class="projectTable mainTableHeader">Acceptable</td>
  174. <td class="projectTable mainTableHeader"><xsl:value-of select="$unvisitedTitle" /></td>
  175. <td class="projectTable mainTableGraphHeader" colspan="2"><xsl:value-of select="$coverageTitle" /></td>
  176. </tr>
  177. <xsl:call-template name="coverageDetail">
  178. <xsl:with-param name="name">
  179. <xsl:choose>
  180. <xsl:when test="string-length(./project/@name) > 0"><xsl:value-of select="./project/@name" /></xsl:when>
  181. <xsl:otherwise>&#160;</xsl:otherwise>
  182. </xsl:choose>
  183. </xsl:with-param>
  184. <xsl:with-param name="unvisitedPoints">
  185. <xsl:choose>
  186. <xsl:when test="$reportType = 'Module Class Function Summary'"><xsl:value-of select="./project/@unvisitedFunctions" /></xsl:when>
  187. <xsl:otherwise><xsl:value-of select="./project/@unvisitedPoints" /></xsl:otherwise>
  188. </xsl:choose>
  189. </xsl:with-param>
  190. <xsl:with-param name="sequencePoints">
  191. <xsl:choose>
  192. <xsl:when test="$reportType = 'Module Class Function Summary'"><xsl:value-of select="./project/@members" /></xsl:when>
  193. <xsl:otherwise><xsl:value-of select="./project/@sequencePoints" /></xsl:otherwise>
  194. </xsl:choose>
  195. </xsl:with-param>
  196. <xsl:with-param name="coverage">
  197. <xsl:choose>
  198. <xsl:when test="$reportType = 'Module Class Function Summary'"><xsl:value-of select="./project/@functionCoverage" /></xsl:when>
  199. <xsl:otherwise><xsl:value-of select="./project/@coverage" /></xsl:otherwise>
  200. </xsl:choose>
  201. </xsl:with-param>
  202. <xsl:with-param name="threshold" select="$threshold" />
  203. <xsl:with-param name="showThreshold">True</xsl:with-param>
  204. </xsl:call-template>
  205. </xsl:template>
  206. <!-- Modules Summary -->
  207. <xsl:template name="moduleSummary">
  208. <xsl:param name="threshold" />
  209. <xsl:param name="unvisitedTitle" />
  210. <xsl:param name="coverageTitle" />
  211. <tr>
  212. <td colspan="5">&#160;</td>
  213. </tr>
  214. <tr>
  215. <td class="primaryTable mainTableHeaderLeft">Modules</td>
  216. <td class="primaryTable mainTableHeader">Acceptable</td>
  217. <td class="primaryTable mainTableHeader"><xsl:value-of select="$unvisitedTitle" /></td>
  218. <td class="primaryTable mainTableGraphHeader" colspan="2"><xsl:value-of select="$coverageTitle" /></td>
  219. </tr>
  220. <xsl:for-each select="./modules/module">
  221. <xsl:call-template name="coverageDetail">
  222. <xsl:with-param name="name" select="./@name" />
  223. <xsl:with-param name="unvisitedPoints" select="./@unvisitedPoints" />
  224. <xsl:with-param name="sequencePoints" select="./@sequencePoints" />
  225. <xsl:with-param name="coverage" select="./@coverage" />
  226. <xsl:with-param name="threshold" select="./@acceptable" />
  227. <xsl:with-param name="showThreshold">True</xsl:with-param>
  228. </xsl:call-template>
  229. </xsl:for-each>
  230. </xsl:template>
  231. <!-- Namespaces per Module Summary -->
  232. <xsl:template name="moduleNamespaceSummary">
  233. <xsl:param name="threshold" />
  234. <xsl:for-each select="./modules/module">
  235. <tr>
  236. <td colspan="5">&#160;</td>
  237. </tr>
  238. <tr>
  239. <td class="secondaryTable mainTableHeaderLeft">Module</td>
  240. <td class="secondaryTable mainTableHeader">Acceptable</td>
  241. <td class="secondaryTable mainTableHeader">Unvisited SeqPts</td>
  242. <td class="secondaryTable mainTableGraphHeader" colspan="2">Coverage</td>
  243. </tr>
  244. <xsl:call-template name="coverageDetailSecondary">
  245. <xsl:with-param name="name" select="./@name" />
  246. <xsl:with-param name="unvisitedPoints" select="./@unvisitedPoints" />
  247. <xsl:with-param name="sequencePoints" select="./@sequencePoints" />
  248. <xsl:with-param name="coverage" select="./@coverage" />
  249. <xsl:with-param name="threshold" select="./@acceptable" />
  250. </xsl:call-template>
  251. <tr>
  252. <td class="secondaryChildTable childTableHeader" colspan="5">Namespaces</td>
  253. </tr>
  254. <xsl:for-each select="./namespace">
  255. <xsl:call-template name="coverageIndentedDetail">
  256. <xsl:with-param name="name" select="./@name" />
  257. <xsl:with-param name="unvisitedPoints" select="./@unvisitedPoints" />
  258. <xsl:with-param name="sequencePoints" select="./@sequencePoints" />
  259. <xsl:with-param name="coverage" select="./@coverage" />
  260. <xsl:with-param name="threshold" select="./../@acceptable" />
  261. </xsl:call-template>
  262. </xsl:for-each>
  263. </xsl:for-each>
  264. </xsl:template>
  265. <!-- Classes per Namespace per Module Summary -->
  266. <xsl:template name="classModuleSummary">
  267. <xsl:param name="threshold" />
  268. <xsl:param name="unvisitedTitle" />
  269. <xsl:param name="coverageTitle" />
  270. <xsl:for-each select="./modules/module">
  271. <tr>
  272. <td colspan="5">&#160;</td>
  273. </tr>
  274. <tr>
  275. <td class="secondaryTable mainTableHeaderLeft">Module</td>
  276. <td class="secondaryTable mainTableHeader">Acceptable</td>
  277. <td class="secondaryTable mainTableHeader"><xsl:value-of select="$unvisitedTitle" /></td>
  278. <td class="secondaryTable mainTableGraphHeader" colspan="2"><xsl:value-of select="$coverageTitle" /></td>
  279. </tr>
  280. <xsl:call-template name="coverageDetailSecondary">
  281. <xsl:with-param name="name" select="./@name" />
  282. <xsl:with-param name="unvisitedPoints" select="./@unvisitedPoints" />
  283. <xsl:with-param name="sequencePoints" select="./@sequencePoints" />
  284. <xsl:with-param name="coverage" select="./@coverage" />
  285. <xsl:with-param name="threshold" select="./@acceptable" />
  286. </xsl:call-template>
  287. <tr>
  288. <td class="secondaryChildTable childTableHeader" colspan="5">Namespace / Classes</td>
  289. </tr>
  290. <xsl:for-each select="./namespace">
  291. <xsl:call-template name="coverageIndentedDetail">
  292. <xsl:with-param name="name" select="./@name" />
  293. <xsl:with-param name="unvisitedPoints" select="./@unvisitedPoints" />
  294. <xsl:with-param name="sequencePoints" select="./@sequencePoints" />
  295. <xsl:with-param name="coverage" select="./@coverage" />
  296. <xsl:with-param name="threshold" select="../@acceptable" />
  297. <xsl:with-param name="styleTweak">padding-left:20px;font-weight:bold</xsl:with-param>
  298. </xsl:call-template>
  299. <xsl:for-each select="./class">
  300. <xsl:call-template name="coverageIndentedDetail">
  301. <xsl:with-param name="name" select="./@name" />
  302. <xsl:with-param name="unvisitedPoints" select="./@unvisitedPoints" />
  303. <xsl:with-param name="sequencePoints" select="./@sequencePoints" />
  304. <xsl:with-param name="coverage" select="./@coverage" />
  305. <xsl:with-param name="threshold" select="../../@acceptable" />
  306. <xsl:with-param name="styleTweak">padding-left:30px</xsl:with-param>
  307. <xsl:with-param name="scale">160</xsl:with-param>
  308. </xsl:call-template>
  309. </xsl:for-each>
  310. </xsl:for-each>
  311. </xsl:for-each>
  312. </xsl:template>
  313. <!-- Coverage detail row in main grid displaying a name, statistics and graph bar -->
  314. <xsl:template name="coverageDetail">
  315. <xsl:param name="name" />
  316. <xsl:param name="unvisitedPoints" />
  317. <xsl:param name="sequencePoints" />
  318. <xsl:param name="coverage" />
  319. <xsl:param name="threshold" />
  320. <xsl:param name="showThreshold" />
  321. <tr>
  322. <xsl:choose>
  323. <xsl:when test="$showThreshold='True'">
  324. <td class="mainTableCellBottom mainTableCellItem"><xsl:value-of select="$name" /></td>
  325. <td class="mainTableCellBottom mainTableCellData"><xsl:value-of select="concat(format-number($threshold,'#0.0'), ' %')" /></td>
  326. </xsl:when>
  327. <xsl:otherwise>
  328. <td class="mainTableCellBottom mainTableCellItem" colspan="2"><xsl:value-of select="$name" /></td>
  329. </xsl:otherwise>
  330. </xsl:choose>
  331. <td class="mainTableCellBottom mainTableCellData"><xsl:value-of select="$unvisitedPoints" /></td>
  332. <td class="mainTableCellBottom mainTableCellPercent"><xsl:value-of select="concat(format-number($coverage,'#0.0'), ' %')" /></td>
  333. <td class="mainTableCellBottom mainTableCellGraph">
  334. <xsl:call-template name="detailPercent">
  335. <xsl:with-param name="notVisited" select="$unvisitedPoints" />
  336. <xsl:with-param name="total" select="$sequencePoints" />
  337. <xsl:with-param name="threshold" select="$threshold" />
  338. <xsl:with-param name="scale" select="200" />
  339. </xsl:call-template>
  340. </td>
  341. </tr>
  342. </xsl:template>
  343. <!-- Coverage detail row in secondary grid header displaying a name, statistics and graph bar -->
  344. <xsl:template name="coverageDetailSecondary">
  345. <xsl:param name="name" />
  346. <xsl:param name="unvisitedPoints" />
  347. <xsl:param name="sequencePoints" />
  348. <xsl:param name="coverage" />
  349. <xsl:param name="threshold" />
  350. <tr>
  351. <td class="mainTableCellItem"><xsl:value-of select="$name" /></td>
  352. <td class="mainTableCellData"><xsl:value-of select="concat(format-number($threshold,'#0.0'), ' %')" /></td>
  353. <td class="mainTableCellData"><xsl:value-of select="$unvisitedPoints" /></td>
  354. <td class="mainTableCellPercent"><xsl:value-of select="concat(format-number($coverage,'#0.0'), ' %')" /></td>
  355. <td class="mainTableCellGraph">
  356. <xsl:call-template name="detailPercent">
  357. <xsl:with-param name="notVisited" select="$unvisitedPoints" />
  358. <xsl:with-param name="total" select="$sequencePoints" />
  359. <xsl:with-param name="threshold" select="$threshold" />
  360. <xsl:with-param name="scale" select="200" />
  361. </xsl:call-template>
  362. </td>
  363. </tr>
  364. </xsl:template>
  365. <!-- Coverage detail row with indented item name and shrunk graph bar -->
  366. <xsl:template name="coverageIndentedDetail">
  367. <xsl:param name="name" />
  368. <xsl:param name="unvisitedPoints" />
  369. <xsl:param name="sequencePoints" />
  370. <xsl:param name="coverage" />
  371. <xsl:param name="threshold" />
  372. <xsl:param name="styleTweak">padding-left:20px</xsl:param>
  373. <xsl:param name="scale">180</xsl:param>
  374. <tr>
  375. <td class="mainTableCellBottom childTableCellIndentedItem" colspan="2"><xsl:attribute name="style"><xsl:value-of select="$styleTweak"/></xsl:attribute><xsl:value-of select="$name" /></td>
  376. <td class="mainTableCellBottom mainTableCellData"><xsl:value-of select="$unvisitedPoints" /></td>
  377. <td class="mainTableCellBottom mainTableCellPercent"><xsl:value-of select="concat(format-number($coverage,'#0.0'), ' %')" /></td>
  378. <td class="mainTableCellBottom mainTableCellGraph">
  379. <xsl:call-template name="detailPercent">
  380. <xsl:with-param name="notVisited" select="$unvisitedPoints" />
  381. <xsl:with-param name="total" select="$sequencePoints" />
  382. <xsl:with-param name="threshold" select="$threshold" />
  383. <xsl:with-param name="scale" select="$scale" />
  384. </xsl:call-template>
  385. </td>
  386. </tr>
  387. </xsl:template>
  388. <!-- Exclusions Summary -->
  389. <xsl:template name="exclusionsSummary">
  390. <tr>
  391. <td colspan="5">&#160;</td>
  392. </tr>
  393. <tr>
  394. <td class="exclusionTable mainTableHeaderLeft" colspan="3">Excluded From Coverage Results</td>
  395. <td class="exclusionTable mainTableGraphHeader" colspan="2">All Code Within</td>
  396. </tr>
  397. <xsl:for-each select="./exclusions/exclusion">
  398. <tr>
  399. <td class="mainTableCellBottom exclusionTableCellItem" colspan="3"><xsl:value-of select="@name" /></td>
  400. <td class="mainTableCellBottom mainTableCellGraph" colspan="2"><xsl:value-of select="@category" /></td>
  401. </tr>
  402. </xsl:for-each>
  403. </xsl:template>
  404. <!-- Footer -->
  405. <xsl:template name="footer">
  406. <tr>
  407. <td colspan="5">&#160;</td>
  408. </tr>
  409. </xsl:template>
  410. <!-- Draw % Green/Red/Yellow Bar -->
  411. <xsl:template name="detailPercent">
  412. <xsl:param name="notVisited" />
  413. <xsl:param name="total" />
  414. <xsl:param name="threshold" />
  415. <xsl:param name="scale" />
  416. <xsl:variable name="visited" select="$total - $notVisited" />
  417. <xsl:variable name="coverage" select="$visited div $total * 100"/>
  418. <table cellpadding="0" cellspacing="0">
  419. <tbody>
  420. <tr>
  421. <xsl:if test="$notVisited = 0">
  422. <td class="graphBarVisitedFully" height="14">
  423. <xsl:attribute name="width">
  424. <xsl:value-of select="$scale" />
  425. </xsl:attribute>.</td>
  426. </xsl:if>
  427. <xsl:if test="($visited != 0) and ($notVisited != 0)">
  428. <td class="graphBarVisited" height="14">
  429. <xsl:attribute name="width">
  430. <xsl:value-of select="format-number($coverage div 100 * $scale, '0') - 1" />
  431. </xsl:attribute>.</td>
  432. </xsl:if>
  433. <xsl:if test="$notVisited != 0">
  434. <td height="14">
  435. <xsl:attribute name="class">
  436. <xsl:if test="$coverage &gt;= $threshold">graphBarSatisfactory</xsl:if>
  437. <xsl:if test="$coverage &lt; $threshold">graphBarNotVisited</xsl:if>
  438. </xsl:attribute>
  439. <xsl:attribute name="width">
  440. <xsl:value-of select="format-number($notVisited div $total * $scale, '0')" />
  441. </xsl:attribute>.</td>
  442. </xsl:if>
  443. </tr>
  444. </tbody>
  445. </table>
  446. </xsl:template>
  447. </xsl:stylesheet>