-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPORTS.xsl
102 lines (99 loc) · 3.43 KB
/
PORTS.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
93
94
95
96
97
98
99
100
101
102
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" />
<xsl:template match="/ports">
<html>
<head>
<title>ASAP ports list</title>
<style>
table { border-collapse: collapse; }
th, td { border: solid black 1px; }
th, .name { background-color: #ccf; }
.good { background-color: #cfc; }
.bad { background-color: #fcc; }
.partial { background-color: #ffc; }
.good, .bad, .partial { text-align: center; }
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>Name</th>
<th>Binary release</th>
<th>Platform</th>
<th>User interface</th>
<th>First appeared in ASAP</th>
<th>Develop­ment status<sup><a href="#status_note">[1]</a></sup></th>
<th>Output</th>
<th>Supports sub­songs?</th>
<th>Shows file infor­mation?</th>
<th>Edits file infor­mation?</th>
<th>Converts to and from SAP?</th>
<th>Configu­rable play­back time?</th>
<th>Mute POKEY chan­nels?</th>
<th>Shows STIL?</th>
<th>Comment</th>
<th>Program­ming lan­guage</th>
<th>Related website</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates />
</tbody>
</table>
<ol>
<li id="status_note">Development status:
<ul>
<li><span class="good">stable</span> - complete</li>
<li><span class="partial">in development</span> - working, but incomplete or buggy</li>
<li><span class="bad">discontinued</span> - present in previous releases, no longer supported</li>
<li><span class="bad">sample</span> - sample code for developers, not recommended for end-users</li>
</ul>
</li>
</ol>
</body>
</html>
</xsl:template>
<xsl:template match="port">
<tr>
<td class="name"><xsl:value-of select="@name" /></td>
<td><xsl:value-of select="bin" /></td>
<td><xsl:value-of select="platform" /></td>
<td><xsl:value-of select="interface" /></td>
<td><xsl:value-of select="since" /></td>
<td>
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="status = 'stable'">good</xsl:when>
<xsl:when test="status = 'in develop­ment'">partial</xsl:when>
<xsl:otherwise>bad</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="status" />
</td>
<td><xsl:value-of select="output" /></td>
<td><xsl:apply-templates select="subsongs" /></td>
<td><xsl:apply-templates select="file-info" /></td>
<td><xsl:apply-templates select="edit-info" /></td>
<td><xsl:apply-templates select="convert-sap" /></td>
<td><xsl:apply-templates select="config-time" /></td>
<td><xsl:apply-templates select="mute-pokey" /></td>
<td><xsl:apply-templates select="stil" /></td>
<td><xsl:apply-templates select="comment" /></td>
<td><xsl:value-of select="lang" /></td>
<td><xsl:copy-of select="a" /></td>
</tr>
</xsl:template>
<xsl:template match="subsongs|file-info|edit-info|convert-sap|config-time|mute-pokey|stil|comment">
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="@class"><xsl:value-of select="@class" /></xsl:when>
<xsl:when test="starts-with(., 'yes')">good</xsl:when>
<xsl:when test=". = 'no'">bad</xsl:when>
<xsl:otherwise>partial</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="." />
</xsl:template>
</xsl:stylesheet>