This repository has been archived by the owner on Jul 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 204
/
changes-html.xsl
92 lines (82 loc) · 2.29 KB
/
changes-html.xsl
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 " ">
<!ENTITY nbsp " ">
]>
<!-- $Id$ -->
<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('<', name(), '>')"/>
<xsl:apply-templates/>
<xsl:value-of select="concat('</', name(), '>')"/>
</xsl:template>
</xsl:stylesheet>