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

tagdiff.xsl 6.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <?xml version="1.0"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- a stylesheet to display changelogs ala netbeans -->
  17. <xsl:stylesheet
  18. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  19. version="1.0">
  20. <xsl:param name="title"/>
  21. <xsl:param name="module"/>
  22. <xsl:param name="cvsweb"/>
  23. <xsl:output method="html" indent="yes"/>
  24. <!-- Copy standard document elements. Elements that
  25. should be ignored must be filtered by apply-templates
  26. tags. -->
  27. <xsl:template match="*">
  28. <xsl:copy>
  29. <xsl:copy-of select="attribute::*[. != '']"/>
  30. <xsl:apply-templates/>
  31. </xsl:copy>
  32. </xsl:template>
  33. <xsl:template match="tagdiff">
  34. <html>
  35. <head>
  36. <title><xsl:value-of select="$title"/></title>
  37. <style type="text/css">
  38. body, p {
  39. font-family: verdana,arial,helvetica;
  40. font-size: 80%;
  41. color:#000000;
  42. }
  43. .dateAndAuthor {
  44. font-family: verdana,arial,helvetica;
  45. font-size: 80%;
  46. font-weight: bold;
  47. text-align:left;
  48. background:#a6caf0;
  49. }
  50. tr, td{
  51. font-family: verdana,arial,helvetica;
  52. font-size: 80%;
  53. background:#eeeee0;
  54. }
  55. </style>
  56. </head>
  57. <body link="#000000" alink="#000000" vlink="#000000" text="#000000">
  58. <h1>
  59. <a name="top"><xsl:value-of select="$title"/></a>
  60. </h1>
  61. Tagdiff between <xsl:value-of select="@startTag"/> <xsl:value-of select="@startDate"/> and
  62. <xsl:value-of select="@endTag"/> <xsl:value-of select="@endDate"/>
  63. <p align="right">Designed for use with <a href="http://ant.apache.org/">Ant</a>.</p>
  64. <hr size="2"/>
  65. <a name="TOP"/>
  66. <table width="100%">
  67. <tr>
  68. <td align="right">
  69. <a href="#New">New Files</a> |
  70. <a href="#Modified">Modified Files</a> |
  71. <a href="#Removed">Removed Files</a>
  72. </td>
  73. </tr>
  74. </table>
  75. <table border="0" width="100%" cellpadding="3" cellspacing="1">
  76. <xsl:call-template name="show-entries">
  77. <xsl:with-param name="title">New Files</xsl:with-param>
  78. <xsl:with-param name="anchor">New</xsl:with-param>
  79. <xsl:with-param name="entries" select=".//entry[file/revision][not(file/prevrevision)]"/>
  80. </xsl:call-template>
  81. <xsl:call-template name="show-entries">
  82. <xsl:with-param name="title">Modified Files</xsl:with-param>
  83. <xsl:with-param name="anchor">Modified</xsl:with-param>
  84. <xsl:with-param name="entries" select=".//entry[file/revision][file/prevrevision]"/>
  85. </xsl:call-template>
  86. <!-- change to entries select to address bug #36827 -->
  87. <xsl:call-template name="show-entries">
  88. <xsl:with-param name="title">Removed Files</xsl:with-param>
  89. <xsl:with-param name="anchor">Removed</xsl:with-param>
  90. <xsl:with-param name="entries" select=".//entry[not(file/revision)][file/prevrevision]"/>
  91. </xsl:call-template>
  92. </table>
  93. </body>
  94. </html>
  95. </xsl:template>
  96. <xsl:template name="show-entries">
  97. <xsl:param name="title"/>
  98. <xsl:param name="anchor"/>
  99. <xsl:param name="entries"/>
  100. <tr>
  101. <td colspan="2" class="dateAndAuthor">
  102. <a>
  103. <xsl:attribute name="name"><xsl:value-of select="$anchor"/></xsl:attribute>
  104. <xsl:value-of select="$title"/> - <xsl:value-of select="count($entries)"/> entries
  105. </a>
  106. <a href="#TOP">(back to top)</a>
  107. </td>
  108. </tr>
  109. <tr>
  110. <td width="20">
  111. <xsl:text> </xsl:text>
  112. </td>
  113. <td>
  114. <ul>
  115. <xsl:apply-templates select="$entries"/>
  116. </ul>
  117. </td>
  118. </tr>
  119. </xsl:template>
  120. <xsl:template match="entry">
  121. <xsl:apply-templates select="file"/>
  122. </xsl:template>
  123. <xsl:template match="date">
  124. <i><xsl:value-of select="."/></i>
  125. </xsl:template>
  126. <xsl:template match="time">
  127. <i><xsl:value-of select="."/></i>
  128. </xsl:template>
  129. <xsl:template match="author">
  130. <i>
  131. <a>
  132. <xsl:attribute name="href">mailto:<xsl:value-of select="."/></xsl:attribute>
  133. <xsl:value-of select="."/>
  134. </a>
  135. </i>
  136. </xsl:template>
  137. <xsl:template match="file">
  138. <li>
  139. <a target="_new">
  140. <xsl:attribute name="href"><xsl:value-of select="$cvsweb"/><xsl:value-of select="$module" />/<xsl:value-of select="name" /></xsl:attribute>
  141. <xsl:value-of select="name" />
  142. </a>
  143. <xsl:if test="string-length(prevrevision) > 0 or string-length(revision) > 0">
  144. <xsl:text> </xsl:text>
  145. <a target="_new">
  146. <xsl:choose>
  147. <xsl:when test="string-length(prevrevision) = 0 ">
  148. <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>
  149. </xsl:when>
  150. <xsl:otherwise>
  151. <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"/>&amp;diff_format=h</xsl:attribute>
  152. </xsl:otherwise>
  153. </xsl:choose> (<xsl:if test="count(prevrevision) &gt; 0"> <xsl:value-of select="prevrevision"/> --&gt; </xsl:if> <xsl:value-of select="revision"/>)
  154. </a>
  155. </xsl:if>
  156. </li>
  157. </xsl:template>
  158. <!-- Any elements within a msg are processed,
  159. so that we can preserve HTML tags. -->
  160. <xsl:template match="msg">
  161. <b><xsl:apply-templates/></b>
  162. </xsl:template>
  163. </xsl:stylesheet>