-
Notifications
You must be signed in to change notification settings - Fork 0
/
stylesheet.xsl
84 lines (83 loc) · 2.37 KB
/
stylesheet.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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/opml">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>
<xsl:value-of select="head/title"/>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<style>
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
max-width: 800px;
margin: 3rem auto;
background-color: #D3D3E7;
color: #333;
text-align: center;
}
h1 {
color: #555;
margin-bottom: 2rem;
}
p {
margin-bottom: 2rem;
color: #2980b9;
}
ul {
list-style-type: none;
padding-left: 0;
}
li {
margin-bottom: 1rem;
padding: 0.5rem;
background-color: #ffffff;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
a {
color: #555;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.feed {
font-size: 0.9rem;
color: #FF1493;
}
</style>
</head>
<body>
<p>
This is a list of blogs I follow. The page
is itself an <a href="http://opml.org/">OPML</a> file, which
means you can copy the link into your RSS reader to
subscribe to all the feeds listed below.
</p>
<ul>
<xsl:apply-templates select="body/outline"/>
</ul>
</body>
</html>
</xsl:template>
<xsl:template match="outline" xmlns="http://www.w3.org/1999/xhtml">
<xsl:choose>
<xsl:when test="@type">
<xsl:choose>
<xsl:when test="@xmlUrl">
<li>
<a href="{@htmlUrl}"><xsl:value-of select="@text"/></a>
(<a class="feed" href="{@xmlUrl}">feed</a>)
<xsl:choose>
<xsl:when test="@description != ''">
<br/><xsl:value-of select="@description"/>
</xsl:when>
</xsl:choose>
</li>
</xsl:when>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>