You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

log.xsl 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  2. <xsl:output method="html" indent="yes" encoding="US-ASCII"/>
  3. <!--
  4. Copyright 2000-2004 The Apache Software Foundation
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. -->
  15. <!--
  16. The purpose have this XSL is to provide a nice way to look at the output
  17. from the Ant XmlLogger (ie: ant -listener org.apache.tools.ant.XmlLogger )
  18. @author <a href="mailto:sbailliez@apache.org">Stephane Bailliez</a>
  19. -->
  20. <xsl:decimal-format decimal-separator="." grouping-separator="," />
  21. <xsl:template match="/">
  22. <html>
  23. <head>
  24. <style type="text/css">
  25. .bannercell {
  26. border: 0px;
  27. padding: 0px;
  28. }
  29. body {
  30. margin: 0;
  31. font:normal 100% arial,helvetica,sanserif;
  32. background-color:#FFFFFF;
  33. color:#000000;
  34. }
  35. table.status {
  36. font:bold 80% arial,helvetica,sanserif;
  37. background-color:#525D76;
  38. color:#ffffff;
  39. }
  40. table.log tr td, tr th {
  41. font-size: 80%;
  42. }
  43. .error {
  44. color:red;
  45. }
  46. .warn {
  47. color:brown;
  48. }
  49. .info {
  50. color:gray;
  51. }
  52. .debug{
  53. color:gray;
  54. }
  55. .failed {
  56. font-size:80%;
  57. background-color: red;
  58. color:#FFFFFF;
  59. font-weight: bold
  60. }
  61. .complete {
  62. font-size:80%;
  63. background-color: #525D76;
  64. color:#FFFFFF;
  65. font-weight: bold
  66. }
  67. .a td {
  68. background: #efefef;
  69. }
  70. .b td {
  71. background: #fff;
  72. }
  73. th, td {
  74. text-align: left;
  75. vertical-align: top;
  76. }
  77. th {
  78. background: #ccc;
  79. color: black;
  80. }
  81. table, th, td {
  82. border: none
  83. }
  84. h3 {
  85. font:bold 80% arial,helvetica,sanserif;
  86. background: #525D76;
  87. color: white;
  88. text-decoration: none;
  89. padding: 5px;
  90. margin-right: 2px;
  91. margin-left: 2px;
  92. margin-bottom: 0;
  93. }
  94. </style>
  95. </head>
  96. <body>
  97. <!-- jakarta logo -->
  98. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  99. <tr>
  100. <td valign="top" class="bannercell">
  101. <a href="http://jakarta.apache.org/">
  102. <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
  103. </a>
  104. </td>
  105. <td style="text-align:right;vertical-align:bottom">
  106. <a href="http://jakarta.apache.org/ant">Apache Ant</a>
  107. </td>
  108. </tr>
  109. </table>
  110. <table border="0" width="100%">
  111. <tr><td><hr noshade="yes" size="1"/></td></tr>
  112. </table>
  113. <xsl:apply-templates select="build"/>
  114. <!-- FOOTER -->
  115. <table width="100%">
  116. <tr><td><hr noshade="yes" size="1"/></td></tr>
  117. <tr><td>
  118. <div align="center"><font color="#525D76" size="-1"><em>
  119. Copyright &#169; 2000-2002, Apache Software Foundation
  120. </em></font></div>
  121. </td></tr>
  122. </table>
  123. </body>
  124. </html>
  125. </xsl:template>
  126. <xsl:template match="build">
  127. <!-- build status -->
  128. <table width="100%">
  129. <xsl:attribute name="class">
  130. <xsl:if test="@error">failed</xsl:if>
  131. <xsl:if test="not(@error)">complete</xsl:if>
  132. </xsl:attribute>
  133. <tr>
  134. <xsl:if test="@error">
  135. <td nowrap="yes">Build Failed</td>
  136. </xsl:if>
  137. <xsl:if test="not(@error)">
  138. <td nowrap="yes">Build Complete</td>
  139. </xsl:if>
  140. <td style="text-align:right" nowrap="yes">Total Time: <xsl:value-of select="@time"/></td>
  141. </tr>
  142. <tr>
  143. <td colspan="2">
  144. <xsl:if test="@error">
  145. <tt><xsl:value-of select="@error"/></tt><br/>
  146. <i style="font-size:80%">See the <a href="#stacktrace" alt="Click for details">stacktrace</a>.</i>
  147. </xsl:if>
  148. </td>
  149. </tr>
  150. </table>
  151. <table border="1" cellspacing="2" cellpadding="3" width="100%" style="font-size:80%">
  152. <tr class="a"><td width="1">ant.file</td><td><xsl:value-of select="substring-after(//message[contains(text(),'ant.file')], '->')"/></td></tr>
  153. <tr class="b"><td width="1">ant.version</td><td><xsl:value-of select="substring-after(//message[contains(text(),'ant.version')], '->')"/></td></tr>
  154. <tr class="a"><td width="1">java.version</td><td><xsl:value-of select="substring-after(//message[contains(text(),'java.vm.version')], '->')"/></td></tr>
  155. <tr class="b"><td width="1">os.name</td><td><xsl:value-of select="substring-after(//message[contains(text(),'os.name')], '->')"/></td></tr>
  156. </table>
  157. <!-- build information -->
  158. <h3>Build events</h3>
  159. <table class="log" border="1" cellspacing="2" cellpadding="3" width="100%">
  160. <tr>
  161. <th nowrap="yes" align="left" width="1%">target</th>
  162. <th nowrap="yes" align="left" width="1%">task</th>
  163. <th nowrap="yes" align="left">message</th>
  164. </tr>
  165. <xsl:apply-templates select=".//message[@priority != 'debug']"/>
  166. </table>
  167. <p>
  168. <!-- stacktrace -->
  169. <xsl:if test="stacktrace">
  170. <a name="stacktrace"/>
  171. <h3>Error details</h3>
  172. <table width="100%">
  173. <tr><td>
  174. <pre><xsl:value-of select="stacktrace"/></pre>
  175. </td></tr>
  176. </table>
  177. </xsl:if>
  178. </p>
  179. </xsl:template>
  180. <!-- report every message but those with debug priority -->
  181. <xsl:template match="message[@priority!='debug']">
  182. <tr valign="top">
  183. <!-- alternated row style -->
  184. <xsl:attribute name="class">
  185. <xsl:if test="position() mod 2 = 1">a</xsl:if>
  186. <xsl:if test="position() mod 2 = 0">b</xsl:if>
  187. </xsl:attribute>
  188. <td nowrap="yes" width="1%"><xsl:value-of select="../../@name"/></td>
  189. <td nowrap="yes" style="text-align:right" width="1%">[ <xsl:value-of select="../@name"/> ]</td>
  190. <td class="{@priority}" nowrap="yes">
  191. <xsl:value-of select="text()"/>
  192. </td>
  193. </tr>
  194. </xsl:template>
  195. </xsl:stylesheet>