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