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.

changelog.xsl 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <xsl:stylesheet
  3. xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
  4. version='1.0'>
  5. <!--
  6. Copyright 2002,2004-2005 The Apache Software Foundation
  7. Licensed under the Apache License, Version 2.0 (the "License");
  8. you may not use this file except in compliance with the License.
  9. You may obtain a copy of the License at
  10. http://www.apache.org/licenses/LICENSE-2.0
  11. Unless required by applicable law or agreed to in writing, software
  12. distributed under the License is distributed on an "AS IS" BASIS,
  13. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. See the License for the specific language governing permissions and
  15. limitations under the License.
  16. -->
  17. <xsl:param name="title"/>
  18. <xsl:param name="module"/>
  19. <xsl:param name="cvsweb"/>
  20. <xsl:output method="html" indent="yes" encoding="US-ASCII"
  21. doctype-public="-//W3C//DTD HTML 4.01//EN"
  22. doctype-system="http://www.w3.org/TR/html401/strict.dtd"/>
  23. <!-- Copy standard document elements. Elements that
  24. should be ignored must be filtered by apply-templates
  25. tags. -->
  26. <xsl:template match="*">
  27. <xsl:copy>
  28. <xsl:copy-of select="attribute::*[. != '']"/>
  29. <xsl:apply-templates/>
  30. </xsl:copy>
  31. </xsl:template>
  32. <xsl:template match="changelog">
  33. <html>
  34. <head>
  35. <title><xsl:value-of select="$title"/></title>
  36. <style type="text/css">
  37. body, p {
  38. font-family: Verdana, Arial, Helvetica, sans-serif;
  39. font-size: 80%;
  40. color: #000000;
  41. background-color: #ffffff;
  42. }
  43. tr, td {
  44. font-family: Verdana, Arial, Helvetica, sans-serif;
  45. background: #eeeee0;
  46. }
  47. td {
  48. padding-left: 20px;
  49. }
  50. .dateAndAuthor {
  51. font-family: Verdana, Arial, Helvetica, sans-serif;
  52. font-weight: bold;
  53. text-align: left;
  54. background: #a6caf0;
  55. padding-left: 3px;
  56. }
  57. a {
  58. color: #000000;
  59. }
  60. pre {
  61. font-weight: bold;
  62. }
  63. </style>
  64. </head>
  65. <body>
  66. <h1>
  67. <a name="top"><xsl:value-of select="$title"/></a>
  68. </h1>
  69. <p style="text-align: right">Designed for use with <a href="http://ant.apache.org/">Apache Ant</a>.</p>
  70. <hr/>
  71. <table border="0" width="100%" cellspacing="1">
  72. <xsl:apply-templates select=".//entry">
  73. <xsl:sort select="date" data-type="text" order="descending"/>
  74. <xsl:sort select="time" data-type="text" order="descending"/>
  75. </xsl:apply-templates>
  76. </table>
  77. </body>
  78. </html>
  79. </xsl:template>
  80. <xsl:template match="entry">
  81. <tr>
  82. <td class="dateAndAuthor">
  83. <xsl:value-of select="date"/><xsl:text> </xsl:text><xsl:value-of select="time"/><xsl:text> </xsl:text><xsl:value-of select="author"/>
  84. </td>
  85. </tr>
  86. <tr>
  87. <td>
  88. <pre>
  89. <xsl:apply-templates select="msg"/></pre>
  90. <ul>
  91. <xsl:apply-templates select="file"/>
  92. </ul>
  93. </td>
  94. </tr>
  95. </xsl:template>
  96. <xsl:template match="date">
  97. <i><xsl:value-of select="."/></i>
  98. </xsl:template>
  99. <xsl:template match="time">
  100. <i><xsl:value-of select="."/></i>
  101. </xsl:template>
  102. <xsl:template match="author">
  103. <i>
  104. <a>
  105. <xsl:attribute name="href">mailto:<xsl:value-of select="."/></xsl:attribute>
  106. <xsl:value-of select="."/></a>
  107. </i>
  108. </xsl:template>
  109. <xsl:template match="file">
  110. <li>
  111. <a>
  112. <xsl:choose>
  113. <xsl:when test="string-length(prevrevision) = 0 ">
  114. <xsl:attribute name="href"><xsl:value-of select="$cvsweb"/><xsl:value-of select="$module" />/<xsl:value-of select="name" />?rev=<xsl:value-of select="revision" />&amp;content-type=text/x-cvsweb-markup</xsl:attribute>
  115. </xsl:when>
  116. <xsl:otherwise>
  117. <xsl:attribute name="href"><xsl:value-of select="$cvsweb"/><xsl:value-of select="$module" />/<xsl:value-of select="name" />?r1=<xsl:value-of select="revision" />&amp;r2=<xsl:value-of select="prevrevision"/></xsl:attribute>
  118. </xsl:otherwise>
  119. </xsl:choose>
  120. <xsl:value-of select="name" /> (<xsl:value-of select="revision"/>)</a>
  121. </li>
  122. </xsl:template>
  123. <!-- Any elements within a msg are processed,
  124. so that we can preserve HTML tags. -->
  125. <xsl:template match="msg">
  126. <xsl:apply-templates/>
  127. </xsl:template>
  128. </xsl:stylesheet>