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 5.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <!-- a stylesheet to display changelogs ala netbeans -->
  2. <xsl:stylesheet
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. version="1.0">
  5. <xsl:param name="title"/>
  6. <xsl:param name="module"/>
  7. <xsl:param name="cvsweb"/>
  8. <xsl:output method="html" indent="yes"/>
  9. <!-- Copy standard document elements. Elements that
  10. should be ignored must be filtered by apply-templates
  11. tags. -->
  12. <xsl:template match="*">
  13. <xsl:copy>
  14. <xsl:copy-of select="attribute::*[. != '']"/>
  15. <xsl:apply-templates/>
  16. </xsl:copy>
  17. </xsl:template>
  18. <xsl:template match="tagdiff">
  19. <HTML>
  20. <HEAD>
  21. <TITLE><xsl:value-of select="$title"/></TITLE>
  22. </HEAD>
  23. <BODY link="#000000" alink="#000000" vlink="#000000" text="#000000">
  24. <style type="text/css">
  25. body, p {
  26. font-family: verdana,arial,helvetica;
  27. font-size: 80%;
  28. color:#000000;
  29. }
  30. .dateAndAuthor {
  31. font-family: verdana,arial,helvetica;
  32. font-size: 80%;
  33. font-weight: bold;
  34. text-align:left;
  35. background:#a6caf0;
  36. }
  37. tr, td{
  38. font-family: verdana,arial,helvetica;
  39. font-size: 80%;
  40. background:#eeeee0;
  41. }
  42. </style>
  43. <h1>
  44. <a name="top"><xsl:value-of select="$title"/></a>
  45. </h1>
  46. Tagdiff between <xsl:value-of select="@startTag"/> <xsl:value-of select="@startDate"/> and
  47. <xsl:value-of select="@endTag"/> <xsl:value-of select="@endDate"/>
  48. <p align="right">Designed for use with <a href="http://jakarta.apache.org">Ant</a>.</p>
  49. <hr size="2"/>
  50. <a name="TOP"/>
  51. <table width="100%">
  52. <tr>
  53. <td align="right">
  54. <a href="#New">New Files</a> |
  55. <a href="#Modified">Modified Files</a> |
  56. <a href="#Removed">Removed Files</a>
  57. </td>
  58. </tr>
  59. </table>
  60. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="3" CELLSPACING="1">
  61. <xsl:call-template name="show-entries">
  62. <xsl:with-param name="title">New Files</xsl:with-param>
  63. <xsl:with-param name="anchor">New</xsl:with-param>
  64. <xsl:with-param name="entries" select=".//entry[file/revision][not(file/prevrevision)]"/>
  65. </xsl:call-template>
  66. <xsl:call-template name="show-entries">
  67. <xsl:with-param name="title">Modified Files</xsl:with-param>
  68. <xsl:with-param name="anchor">Modified</xsl:with-param>
  69. <xsl:with-param name="entries" select=".//entry[file/revision][file/prevrevision]"/>
  70. </xsl:call-template>
  71. <xsl:call-template name="show-entries">
  72. <xsl:with-param name="title">Removed Files</xsl:with-param>
  73. <xsl:with-param name="anchor">Removed</xsl:with-param>
  74. <xsl:with-param name="entries" select=".//entry[not(file/revision)][not(file/prevrevision)]"/>
  75. </xsl:call-template>
  76. </TABLE>
  77. </BODY>
  78. </HTML>
  79. </xsl:template>
  80. <xsl:template name="show-entries">
  81. <xsl:param name="title"/>
  82. <xsl:param name="anchor"/>
  83. <xsl:param name="entries"/>
  84. <TR>
  85. <TD colspan="2" class="dateAndAuthor">
  86. <a>
  87. <xsl:attribute name="name"><xsl:value-of select="$anchor"/></xsl:attribute>
  88. <xsl:value-of select="$title"/> - <xsl:value-of select="count($entries)"/> entries
  89. </a>
  90. <a href="#TOP">(back to top)</a>
  91. </TD>
  92. </TR>
  93. <TR>
  94. <TD width="20">
  95. <xsl:text> </xsl:text>
  96. </TD>
  97. <TD>
  98. <ul>
  99. <xsl:apply-templates select="$entries"/>
  100. </ul>
  101. </TD>
  102. </TR>
  103. </xsl:template>
  104. <xsl:template match="entry">
  105. <xsl:apply-templates select="file"/>
  106. </xsl:template>
  107. <xsl:template match="date">
  108. <i><xsl:value-of select="."/></i>
  109. </xsl:template>
  110. <xsl:template match="time">
  111. <i><xsl:value-of select="."/></i>
  112. </xsl:template>
  113. <xsl:template match="author">
  114. <i>
  115. <a>
  116. <xsl:attribute name="href">mailto:<xsl:value-of select="."/></xsl:attribute>
  117. <xsl:value-of select="."/>
  118. </a>
  119. </i>
  120. </xsl:template>
  121. <xsl:template match="file">
  122. <li>
  123. <a target="_new">
  124. <xsl:attribute name="href"><xsl:value-of select="$cvsweb"/><xsl:value-of select="$module" />/<xsl:value-of select="name" /></xsl:attribute>
  125. <xsl:value-of select="name" />
  126. </a>
  127. <xsl:if test="string-length(prevrevision) > 0 or string-length(revision) > 0">
  128. <xsl:text> </xsl:text>
  129. <a target="_new">
  130. <xsl:choose>
  131. <xsl:when test="string-length(prevrevision) = 0 ">
  132. <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>
  133. </xsl:when>
  134. <xsl:otherwise>
  135. <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>
  136. </xsl:otherwise>
  137. </xsl:choose> (<xsl:value-of select="revision"/>)
  138. </a>
  139. </xsl:if>
  140. </li>
  141. </xsl:template>
  142. <!-- Any elements within a msg are processed,
  143. so that we can preserve HTML tags. -->
  144. <xsl:template match="msg">
  145. <b><xsl:apply-templates/></b>
  146. </xsl:template>
  147. </xsl:stylesheet>