/
style.xsl
127 lines (121 loc) · 5.2 KB
/
style.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:doap="http://usefulinc.com/ns/doap#"
xmlns:xmpp="https://linkmauve.fr/ns/xmpp-doap#"
xmlns:schema="https://schema.org/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>
<xsl:output method="html"/>
<xsl:template match="doap:Project">
<html>
<head>
<link href="../style.css" type="text/css" rel="stylesheet"/>
<title><xsl:value-of select="doap:name"/> - XMPP implementation support</title>
</head>
<body>
<div class="header">
<h1><xsl:apply-templates select="schema:logo"/> <xsl:value-of select="doap:name"/></h1>
<p class="shortdesc"><xsl:value-of select="doap:shortdesc"/></p>
<p class="description"><xsl:value-of select="doap:description"/></p>
<p>
<xsl:apply-templates select="doap:homepage"/>
<xsl:apply-templates select="doap:download-page"/>
<xsl:apply-templates select="schema:documentation"/>
</p>
</div>
<div class="os">
<p>Supported operating systems</p>
<xsl:apply-templates select="doap:os" />
</div>
<xsl:choose>
<xsl:when test="doap:implements">
<table>
<tr>
<th>XMPP Extension</th>
<th>Implemented Version</th>
<th>Status</th>
<th>Since</th>
<th>Notes</th>
</tr>
<xsl:apply-templates select="doap:implements/*"/>
</table>
</xsl:when>
<xsl:otherwise>
<p class="no-info">No info about supported extensions available.</p>
</xsl:otherwise>
</xsl:choose>
</body>
</html>
</xsl:template>
<xsl:template match="schema:logo">
<img src="{@rdf:resource}" alt="logo" width="96" height="96" />
</xsl:template>
<xsl:template match="doap:homepage">
<a class="button" href="{@rdf:resource}">Website</a>
</xsl:template>
<xsl:template match="doap:download-page">
<a class="button" href="{@rdf:resource}">Download</a>
</xsl:template>
<xsl:template match="schema:documentation">
<a class="button" href="{@rdf:resource}">Documentation</a>
</xsl:template>
<xsl:template match="doap:os">
<div class="chip">
<xsl:value-of select="."/>
</div>
</xsl:template>
<xsl:template match="xmpp:SupportedXep">
<!--
Get the definition of the XEP that this block refers to.
We will use that to extract the details of the latest revision and
the one that is implemented, so that we can show that info as well
as check if it is the latest revision that is being used.
-->
<xsl:variable
name="xepnumber"
select="substring-before(substring-after(xmpp:xep/@rdf:resource, 'https://xmpp.org/extensions/xep-'), '.')"
/>
<xsl:variable
name="xeplist"
select="document('https://xmpp.org/extensions/xeplist.xml')/xep-infos"
/>
<xsl:variable
name="xep-descriptor"
select="$xeplist/xep[number/text() = number($xepnumber)]"
/>
<tr>
<td>
<a href="{xmpp:xep/@rdf:resource}" title="{$xep-descriptor/abstract/text()}" id="xep-{$xepnumber}" target="_blank">
XEP-<xsl:value-of select="$xepnumber"/>
<xsl:if test="$xep-descriptor/title/node()">
<xsl:text>: </xsl:text>
<xsl:value-of select="$xep-descriptor/title/node()"/>
</xsl:if>
</a>
</td>
<td>
<span class="version">
<xsl:value-of select="xmpp:version"/>
<xsl:text> </xsl:text>
</span>
<xsl:if test="$xep-descriptor/last-revision/version/text() != xmpp:version">
<br></br>
<span title="{$xep-descriptor/last-revision/date/text()}" class="version version-outdated">
<xsl:text>latest: </xsl:text>
<xsl:value-of select="$xep-descriptor/last-revision/version/text()"/>
<xsl:text> </xsl:text>
</span>
</xsl:if>
</td>
<td>
<span class="xep-implementation-status {xmpp:status}"><xsl:value-of select="xmpp:status"/></span>
</td>
<td>
<span class="version"><xsl:value-of select="xmpp:since"/></span>
</td>
<td>
<span class="small"><xsl:value-of select="xmpp:note"/></span>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>