insilmaril@207
|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?>
|
insilmaril@207
|
2 |
<!DOCTYPE xsl:stylesheet
|
insilmaril@207
|
3 |
[
|
insilmaril@207
|
4 |
<!-- Namespace for XHTML -->
|
insilmaril@207
|
5 |
<!ENTITY xhtmlns "http://www.w3.org/1999/xhtml">
|
insilmaril@207
|
6 |
]>
|
insilmaril@207
|
7 |
|
insilmaril@207
|
8 |
<!--
|
insilmaril@207
|
9 |
Author : Uwe Drechsel <vym@InSilmaril.de>
|
insilmaril@207
|
10 |
Description : transforms KDE Bookmarks into vym map
|
insilmaril@207
|
11 |
-->
|
insilmaril@207
|
12 |
|
insilmaril@207
|
13 |
<xsl:stylesheet version="1.0"
|
insilmaril@207
|
14 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
insilmaril@207
|
15 |
xmlns:date="http://exslt.org/dates-and-times"
|
insilmaril@207
|
16 |
extension-element-prefixes="date"
|
insilmaril@207
|
17 |
xmlns="&xhtmlns;">
|
insilmaril@207
|
18 |
|
insilmaril@207
|
19 |
|
insilmaril@207
|
20 |
<xsl:output method="xml"
|
insilmaril@207
|
21 |
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
|
insilmaril@207
|
22 |
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
|
insilmaril@207
|
23 |
encoding="UTF-8"
|
insilmaril@207
|
24 |
indent="yes"
|
insilmaril@207
|
25 |
media-type="application/xhtml+xml"/>
|
insilmaril@207
|
26 |
|
insilmaril@207
|
27 |
|
insilmaril@207
|
28 |
|
insilmaril@207
|
29 |
<!-- ======================================= -->
|
insilmaril@207
|
30 |
<!-- 1 = true, 0 = false -->
|
insilmaril@207
|
31 |
|
insilmaril@207
|
32 |
<!-- Debuggin on/off? -->
|
insilmaril@207
|
33 |
<xsl:param name="debug" select="0"/>
|
insilmaril@207
|
34 |
|
insilmaril@207
|
35 |
|
insilmaril@207
|
36 |
|
insilmaril@207
|
37 |
|
insilmaril@207
|
38 |
<!-- ======================================= -->
|
insilmaril@207
|
39 |
<xsl:variable name="head.title">
|
insilmaril@207
|
40 |
<xsl:choose>
|
insilmaril@207
|
41 |
<xsl:when test="/vymmap/mapcenter/heading">
|
insilmaril@207
|
42 |
|
insilmaril@207
|
43 |
<xsl:variable name="title">
|
insilmaril@207
|
44 |
</xsl:variable>
|
insilmaril@207
|
45 |
|
insilmaril@207
|
46 |
<xsl:value-of select="$title"/>
|
insilmaril@207
|
47 |
</xsl:when>
|
insilmaril@207
|
48 |
<xsl:otherwise></xsl:otherwise>
|
insilmaril@207
|
49 |
</xsl:choose>
|
insilmaril@207
|
50 |
</xsl:variable>
|
insilmaril@207
|
51 |
|
insilmaril@207
|
52 |
|
insilmaril@207
|
53 |
|
insilmaril@207
|
54 |
|
insilmaril@207
|
55 |
<!-- ======================================= -->
|
insilmaril@207
|
56 |
<xsl:template match="*">
|
insilmaril@207
|
57 |
<xsl:message>
|
insilmaril@207
|
58 |
<xsl:text>WARNING: Unknown tag "</xsl:text>
|
insilmaril@207
|
59 |
<xsl:value-of select="local-name(.)"/>
|
insilmaril@207
|
60 |
<xsl:text>": </xsl:text>
|
insilmaril@207
|
61 |
<xsl:value-of select="normalize-space(.)"/>
|
insilmaril@207
|
62 |
<xsl:text> </xsl:text>
|
insilmaril@207
|
63 |
</xsl:message>
|
insilmaril@207
|
64 |
</xsl:template>
|
insilmaril@207
|
65 |
|
insilmaril@207
|
66 |
|
insilmaril@207
|
67 |
|
insilmaril@207
|
68 |
|
insilmaril@207
|
69 |
<xsl:template match="xbel">
|
insilmaril@207
|
70 |
<vymmap version="1.7.8">
|
insilmaril@207
|
71 |
<mapcenter>
|
insilmaril@207
|
72 |
<heading>Bookmarks</heading>
|
insilmaril@207
|
73 |
<branch frameType="Rectangle">
|
insilmaril@207
|
74 |
<heading>KDE</heading>
|
insilmaril@207
|
75 |
<xsl:apply-templates/>
|
insilmaril@207
|
76 |
</branch>
|
insilmaril@207
|
77 |
</mapcenter>
|
insilmaril@207
|
78 |
</vymmap>
|
insilmaril@207
|
79 |
</xsl:template>
|
insilmaril@207
|
80 |
|
insilmaril@207
|
81 |
|
insilmaril@207
|
82 |
<xsl:template match="folder">
|
insilmaril@207
|
83 |
<branch scrolled="yes">
|
insilmaril@207
|
84 |
<xsl:apply-templates/>
|
insilmaril@207
|
85 |
</branch>
|
insilmaril@207
|
86 |
</xsl:template>
|
insilmaril@207
|
87 |
|
insilmaril@207
|
88 |
<xsl:template match="title">
|
insilmaril@207
|
89 |
<heading>
|
insilmaril@207
|
90 |
<xsl:apply-templates/>
|
insilmaril@207
|
91 |
</heading>
|
insilmaril@207
|
92 |
</xsl:template>
|
insilmaril@207
|
93 |
|
insilmaril@207
|
94 |
<xsl:template match="separator">
|
insilmaril@207
|
95 |
<branch>
|
insilmaril@207
|
96 |
<heading>***************</heading>
|
insilmaril@207
|
97 |
</branch>
|
insilmaril@207
|
98 |
</xsl:template>
|
insilmaril@207
|
99 |
|
insilmaril@207
|
100 |
<xsl:template match="desc">
|
insilmaril@207
|
101 |
<htmlnote fonthint="var">
|
insilmaril@207
|
102 |
<html>
|
insilmaril@207
|
103 |
<body style="font-size:10pt;font-family:Sans Serif">
|
insilmaril@207
|
104 |
<p>
|
insilmaril@207
|
105 |
<xsl:value-of select="." />
|
insilmaril@207
|
106 |
</p>
|
insilmaril@207
|
107 |
</body>
|
insilmaril@207
|
108 |
</html>
|
insilmaril@207
|
109 |
|
insilmaril@207
|
110 |
</htmlnote>
|
insilmaril@207
|
111 |
</xsl:template>
|
insilmaril@207
|
112 |
|
insilmaril@207
|
113 |
<xsl:template match="bookmark">
|
insilmaril@207
|
114 |
<branch>
|
insilmaril@207
|
115 |
<xsl:attribute name="url" ><xsl:value-of select="@href" />
|
insilmaril@207
|
116 |
</xsl:attribute>
|
insilmaril@207
|
117 |
<xsl:apply-templates/>
|
insilmaril@207
|
118 |
</branch>
|
insilmaril@207
|
119 |
</xsl:template>
|
insilmaril@207
|
120 |
|
insilmaril@207
|
121 |
|
insilmaril@207
|
122 |
<!-- Do nothing! We don't need some informational elements -->
|
insilmaril@207
|
123 |
<xsl:template match="info*"/>
|
insilmaril@207
|
124 |
|
insilmaril@207
|
125 |
|
insilmaril@207
|
126 |
</xsl:stylesheet>
|