/asl/lib/checkstyle/xsl/checkstyle-noframes.xsl

http://mp-rechnungs-und-kundenverwaltung.googlecode.com/ · Extensible Stylesheet Language Transformations · 179 lines · 160 code · 19 blank · 0 comment · 0 complexity · fd6339d6ab6c134c5bf3680d0e58e9fc MD5 · raw file

  1. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  2. <xsl:output method="html" indent="yes"/>
  3. <xsl:decimal-format decimal-separator="." grouping-separator="," />
  4. <!-- Checkstyle XML Style Sheet by Stephane Bailliez <sbailliez@apache.org> -->
  5. <!-- Part of the Checkstyle distribution found at http://checkstyle.sourceforge.net -->
  6. <!-- Usage (generates checkstyle_report.html): -->
  7. <!-- <checkstyle failonviolation="false" config="${check.config}"> -->
  8. <!-- <fileset dir="${src.dir}" includes="**/*.java"/> -->
  9. <!-- <formatter type="xml" toFile="${doc.dir}/checkstyle_report.xml"/> -->
  10. <!-- </checkstyle> -->
  11. <!-- <style basedir="${doc.dir}" destdir="${doc.dir}" -->
  12. <!-- includes="checkstyle_report.xml" -->
  13. <!-- style="${doc.dir}/checkstyle-noframes.xsl"/> -->
  14. <xsl:template match="checkstyle">
  15. <html>
  16. <head>
  17. <style type="text/css">
  18. .bannercell {
  19. border: 0px;
  20. padding: 0px;
  21. }
  22. body {
  23. margin-left: 10;
  24. margin-right: 10;
  25. font:normal 80% arial,helvetica,sanserif;
  26. background-color:#FFFFFF;
  27. color:#000000;
  28. }
  29. .a td {
  30. background: #efefef;
  31. }
  32. .b td {
  33. background: #fff;
  34. }
  35. th, td {
  36. text-align: left;
  37. vertical-align: top;
  38. }
  39. th {
  40. font-weight:bold;
  41. background: #ccc;
  42. color: black;
  43. }
  44. table, th, td {
  45. font-size:100%;
  46. border: none
  47. }
  48. table.log tr td, tr th {
  49. }
  50. h2 {
  51. font-weight:bold;
  52. font-size:140%;
  53. margin-bottom: 5;
  54. }
  55. h3 {
  56. font-size:100%;
  57. font-weight:bold;
  58. background: #525D76;
  59. color: white;
  60. text-decoration: none;
  61. padding: 5px;
  62. margin-right: 2px;
  63. margin-left: 2px;
  64. margin-bottom: 0;
  65. }
  66. </style>
  67. </head>
  68. <body>
  69. <a name="top"></a>
  70. <!-- jakarta logo -->
  71. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  72. <tr>
  73. <td class="bannercell" rowspan="2">
  74. <!--a href="http://jakarta.apache.org/">
  75. <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
  76. </a-->
  77. </td>
  78. <td class="text-align:right"><h2>CheckStyle Audit</h2></td>
  79. </tr>
  80. <tr>
  81. <td class="text-align:right">Designed for use with <a href='http://checkstyle.sourceforge.net/'>CheckStyle</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td>
  82. </tr>
  83. </table>
  84. <hr size="1"/>
  85. <!-- Summary part -->
  86. <xsl:apply-templates select="." mode="summary"/>
  87. <hr size="1" width="100%" align="left"/>
  88. <!-- Package List part -->
  89. <xsl:apply-templates select="." mode="filelist"/>
  90. <hr size="1" width="100%" align="left"/>
  91. <!-- For each package create its part -->
  92. <xsl:for-each select="file">
  93. <xsl:sort select="@name"/>
  94. <xsl:apply-templates select="."/>
  95. <p/>
  96. <p/>
  97. </xsl:for-each>
  98. <hr size="1" width="100%" align="left"/>
  99. </body>
  100. </html>
  101. </xsl:template>
  102. <xsl:template match="checkstyle" mode="filelist">
  103. <h3>Files</h3>
  104. <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
  105. <tr>
  106. <th>Name</th>
  107. <th>Errors</th>
  108. </tr>
  109. <xsl:for-each select="file">
  110. <xsl:sort select="@name"/>
  111. <xsl:variable name="errorCount" select="count(error)"/>
  112. <tr>
  113. <xsl:call-template name="alternated-row"/>
  114. <td><a href="#f-{@name}"><xsl:value-of select="@name"/></a></td>
  115. <td><xsl:value-of select="$errorCount"/></td>
  116. </tr>
  117. </xsl:for-each>
  118. </table>
  119. </xsl:template>
  120. <xsl:template match="file">
  121. <a name="f-{@name}"></a>
  122. <h3>File <xsl:value-of select="@name"/></h3>
  123. <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
  124. <tr>
  125. <th>Error Description</th>
  126. <th>Line</th>
  127. </tr>
  128. <xsl:for-each select="error">
  129. <tr>
  130. <xsl:call-template name="alternated-row"/>
  131. <td><xsl:value-of select="@message"/></td>
  132. <td><xsl:value-of select="@line"/></td>
  133. </tr>
  134. </xsl:for-each>
  135. </table>
  136. <a href="#top">Back to top</a>
  137. </xsl:template>
  138. <xsl:template match="checkstyle" mode="summary">
  139. <h3>Summary</h3>
  140. <xsl:variable name="fileCount" select="count(file)"/>
  141. <xsl:variable name="errorCount" select="count(file/error)"/>
  142. <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
  143. <tr>
  144. <th>Files</th>
  145. <th>Errors</th>
  146. </tr>
  147. <tr>
  148. <xsl:call-template name="alternated-row"/>
  149. <td><xsl:value-of select="$fileCount"/></td>
  150. <td><xsl:value-of select="$errorCount"/></td>
  151. </tr>
  152. </table>
  153. </xsl:template>
  154. <xsl:template name="alternated-row">
  155. <xsl:attribute name="class">
  156. <xsl:if test="position() mod 2 = 1">a</xsl:if>
  157. <xsl:if test="position() mod 2 = 0">b</xsl:if>
  158. </xsl:attribute>
  159. </xsl:template>
  160. </xsl:stylesheet>