File: changes-html.xsl

package info (click to toggle)
varnish 1.1.2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 3,220 kB
  • ctags: 1,778
  • sloc: ansic: 17,911; sh: 9,315; xml: 692; makefile: 353
file content (92 lines) | stat: -rw-r--r-- 2,399 bytes parent folder | download
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
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet [
 <!ENTITY space "&#32;">
 <!ENTITY nbsp "&#160;">
]>
<!-- $Id: changes-html.xsl 1906 2007-08-20 19:20:48Z des $ -->
<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns="http://www.w3.org/1999/xhtml">
  <xsl:output method="xml" encoding="utf-8" media-type="text/html" indent="yes"/>

  <xsl:strip-space elements="*"/>

  <xsl:template match="/changelog">
    <html>
      <head>
	<title><xsl:call-template name="title"/></title>
	<link rel="stylesheet" type="text/css" href="changes.css"/>
      </head>
      <body>
	<h1><xsl:call-template name="title"/></h1>
	<xsl:apply-templates select="group"/>
      </body>
    </html>
  </xsl:template>

  <xsl:template name="title">
    <xsl:text>Change log for&space;</xsl:text>
    <xsl:value-of select="package"/>
    <xsl:text>&space;</xsl:text>
    <xsl:value-of select="version"/>
  </xsl:template>

  <xsl:template match="group">
    <h2>
      <xsl:text>Changes between&space;</xsl:text>
      <xsl:value-of select="@from"/>
      <xsl:text>&space;and&space;</xsl:text>
      <xsl:value-of select="@to"/>
    </h2>
    <xsl:apply-templates select="subsystem"/>
  </xsl:template>

  <xsl:template match="subsystem">
    <h3>
      <xsl:value-of select="name"/>
    </h3>
    <ul>
      <xsl:apply-templates select="change"/>
    </ul>
  </xsl:template>

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

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

  <xsl:template match="ticket">
    <a>
      <xsl:attribute name="href">
	<xsl:text>http://varnish.projects.linpro.no/ticket/</xsl:text>
	<xsl:value-of select="@ref"/>
      </xsl:attribute>
      <xsl:text>ticket #</xsl:text>
      <xsl:value-of select="@ref"/>
    </a>
  </xsl:template>

  <xsl:template match="code">
    <span>
      <xsl:attribute name="class">
	<xsl:value-of select="name()"/>
      </xsl:attribute>
      <xsl:apply-templates/>
    </span>
  </xsl:template>

  <xsl:template match="*" priority="-1">
    <xsl:message>Warning: no template for element <xsl:value-of select="name(
)"/></xsl:message>
    <xsl:value-of select="concat('&lt;', name(), '&gt;')"/>
    <xsl:apply-templates/>
    <xsl:value-of select="concat('&lt;/', name(), '&gt;')"/>
  </xsl:template>
</xsl:stylesheet>