-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathtemplate.xslt
108 lines (101 loc) · 3.73 KB
/
template.xslt
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
<!--
Copyright (C) 2017-2022 Opsmate, Inc.
This Source Code Form is subject to the terms of the Mozilla
Public License, v. 2.0. If a copy of the MPL was not distributed
with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
This software is distributed WITHOUT A WARRANTY OF ANY KIND.
See the Mozilla Public License for details.
-->
<xsl:stylesheet version="1.0"
exclude-result-prefixes="caa xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:caa="http://xmlns.sslmate.com/caa">
<xsl:output
method="html"
encoding="UTF-8"
indent="no"
doctype-system="about:legacy-compat"
omit-xml-declaration="yes" />
<xsl:param name="sslmate_domain"/>
<xsl:template mode="copy" match="comment()" priority="11"/>
<xsl:template mode="copy" match="xhtml:*" priority="11">
<xsl:element name="{local-name()}">
<xsl:apply-templates mode="copy" select="@*|node()"/>
</xsl:element>
</xsl:template>
<xsl:template mode="copy" match="@*|node()" priority="10">
<xsl:copy>
<xsl:apply-templates mode="copy" select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/" priority="20">
<xsl:apply-templates select="/caa:page"/>
</xsl:template>
<xsl:template match="caa:page">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title><xsl:value-of select="caa:title"/></title>
<meta name="robots" content="noarchive" />
<link rel="icon" type="image/png" href="https://sslmate.com/assets/img/favicon.png" />
<link rel="stylesheet" type="text/css" href="style.css" />
<xsl:apply-templates mode="copy" select="caa:head/node()"/>
</head>
<body data-sslmate-domain="{$sslmate_domain}">
<a id="github_ribbon" href="https://github.com/SSLMate/caa_helper"></a>
<div id="root">
<div id="masthead">
<h1>CAA Record Helper</h1>
<p class="by">By <a href="https://sslmate.com">SSLMate</a></p>
<ul class="nav">
<li><a href=".">Generate CAA Record</a></li><xsl:text> </xsl:text>
<li><a href="support">Who Supports CAA?</a></li><xsl:text> </xsl:text>
<li><a href="about">About CAA</a></li>
</ul>
</div>
<xsl:apply-templates mode="copy" select="caa:body/node()"/>
<div id="footer">
<p>© 2022 Opsmate, Inc.</p>
</div>
</div>
</body>
</html>
</xsl:template>
<xsl:template mode="copy" match="caa:support" priority="20">
<table class="support">
<thead>
<th class="name">Software/Provider</th>
<th class="support">Support</th>
<th class="comments">Comments</th>
</thead>
<tbody>
<xsl:apply-templates mode="support_table_row" select="caa:software|caa:provider">
<xsl:sort select="translate(caa:name, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
</xsl:apply-templates>
</tbody>
</table>
</xsl:template>
<xsl:template mode="support_table_row" match="caa:software|caa:provider">
<tr>
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="@support='no'">unsupported</xsl:when>
<xsl:when test="@support='broken'">broken</xsl:when>
<xsl:otherwise>supported</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<td class="name"><xsl:value-of select="caa:name"/></td>
<td class="support">
<xsl:choose>
<xsl:when test="@support='no'">No</xsl:when>
<xsl:when test="@support='broken'">Broken</xsl:when>
<xsl:when test="caa:version">≥<xsl:value-of select="caa:version"/></xsl:when>
<xsl:otherwise>Yes</xsl:otherwise>
</xsl:choose>
</td>
<td class="comments"><xsl:apply-templates mode="copy" select="caa:comments/node()"/></td>
</tr>
</xsl:template>
</xsl:stylesheet>