-
Notifications
You must be signed in to change notification settings - Fork 4
/
Blogposter.xsl
100 lines (78 loc) · 2.71 KB
/
Blogposter.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
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tomboy="http://beatniksoftware.com/tomboy"
xmlns:size="http://beatniksoftware.com/tomboy/size"
xmlns:link="http://beatniksoftware.com/tomboy/link"
xmlns="http://www.w3.org/1999/xhtml"
version='1.0' exclude-result-prefixes="tomboy size link">
<xsl:output method="html" indent="no" omit-xml-declaration="yes"/>
<xsl:preserve-space elements="*" />
<xsl:param name="newline" select="'
'" />
<xsl:template match="/">
<div>
<xsl:apply-templates select="tomboy:note/tomboy:text/node()"/>
</div>
</xsl:template>
<xsl:template match="tomboy:note/tomboy:text/*[1]/text()[1]">
<xsl:value-of select="substring-after(., $newline)"/>
</xsl:template>
<xsl:template match="tomboy:bold">
<b><xsl:apply-templates select="node()"/></b>
</xsl:template>
<xsl:template match="tomboy:italic">
<i><xsl:apply-templates select="node()"/></i>
</xsl:template>
<xsl:template match="tomboy:strikethrough">
<span style="text-decoration: line-through;"><xsl:apply-templates select="node()"/></span>
</xsl:template>
<xsl:template match="tomboy:highlight">
<span style="background:yellow"><xsl:apply-templates select="node()"/></span>
</xsl:template>
<xsl:template match="tomboy:datetime">
<span style="font-style:italic;font-size:small;color:grey">
<xsl:apply-templates select="node()"/>
</span>
</xsl:template>
<xsl:template match="size:small">
<span style="font-size:small"><xsl:apply-templates select="node()"/></span>
</xsl:template>
<xsl:template match="size:large">
<h3><xsl:apply-templates select="node()"/></h3>
</xsl:template>
<xsl:template match="size:huge">
<h2><xsl:apply-templates select="node()"/></h2>
</xsl:template>
<xsl:template match="link:broken">
<xsl:value-of select="node()"/>
</xsl:template>
<xsl:template match="link:internal">
<xsl:value-of select="node()"/>
</xsl:template>
<xsl:template match="link:url">
<a href="{node()}"><xsl:value-of select="node()"/></a>
</xsl:template>
<xsl:template match="tomboy:list">
<ul>
<xsl:apply-templates select="tomboy:list-item" />
</ul>
</xsl:template>
<xsl:template match="tomboy:list-item">
<li>
<xsl:if test="normalize-space(text()) = ''">
<xsl:attribute name="style">list-style-type: none</xsl:attribute>
</xsl:if>
<xsl:attribute name="dir">
<xsl:value-of select="@dir"/>
</xsl:attribute>
<xsl:apply-templates select="node()" />
</li>
</xsl:template>
<!-- Evolution.dll Plugin -->
<xsl:template match="link:evo-mail">
<xsl:value-of select="node()"/>
</xsl:template>
<!-- FixedWidth.dll Plugin -->
<xsl:template match="tomboy:monospace">
<span style="font-family:monospace"><xsl:apply-templates select="node()"/></span>
</xsl:template>
</xsl:stylesheet>