summaryrefslogtreecommitdiffstats
path: root/tools/resources/stylesheets/changelog.xsl
blob: 20f7cf9fb6343b6e7a834ea6f788e1aa3c8ca754 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?xml version="1.0"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

    <xsl:output indent="yes"/>

    <xsl:param name="module">module</xsl:param>
    <xsl:param name="cvsweb">cvsweb</xsl:param>
                
    <xsl:template match="/">

        <html>
            <head>
                <link rel="stylesheet" type="text/css" href="../../../../html/javadoc.css" title="Style"></link>
            </head>
            <body bgcolor="white">
                <h1>Change Log</h1>

                    <xsl:apply-templates select="changelog/entry">
			<xsl:sort order="descending" select="date" />
		    </xsl:apply-templates>
    
            </body>
        </html>
        
    </xsl:template>
  
    <xsl:template match="entry">
        
        <h2>
            <xsl:call-template name="escape-return">
              <xsl:with-param name="string"><xsl:value-of select="msg"/></xsl:with-param>
            </xsl:call-template>
        </h2>
        <p>
            <b>
                <xsl:apply-templates select="date"/>
                by <xsl:value-of disable-output-escaping="yes" select="author"/>
            </b>
        </p>
        <p>
            <xsl:apply-templates select="file"/>
        </p>
        <hr/>
            
    </xsl:template>

    <xsl:template match="date">
        <xsl:apply-templates/>
    </xsl:template>

    <xsl:template match="weekday">
        <xsl:apply-templates/>
    </xsl:template>

    <xsl:template match="time">
        <xsl:apply-templates/>
    </xsl:template>

    <xsl:template match="file">
        <br/><a>
	<xsl:choose>
	    <xsl:when test="string-length(prevrevision) = 0 ">
                <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>
	    </xsl:when>
	    <xsl:otherwise>
                <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>
	    </xsl:otherwise>
	</xsl:choose>
        <xsl:value-of select="name" />
        </a>
    </xsl:template>

  <xsl:template name="escape-return">
    <xsl:param name="string"/>
      <!-- must be a better way to define a carrige return -->
      <xsl:variable name="return"><xsl:text>
</xsl:text>
      </xsl:variable>
      <xsl:choose>
        <xsl:when test="contains($string, $return)">
          <xsl:value-of select="substring-before($string, $return)"/><br/>
          <xsl:call-template name="escape-return">
            <xsl:with-param name="string">
              <xsl:value-of select="substring-after($string, $return)"/>
            </xsl:with-param>
          </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$string"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>

</xsl:stylesheet>