styles/kdebookmarks2vym.xsl
author insilmaril
Mon, 18 Jun 2007 15:10:19 +0000
changeset 507 2f57a7d2315e
parent 321 220e40e6c4ff
permissions -rw-r--r--
1.8.73 - beta testing
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
<xsl:variable name="head.title">
insilmaril@207
    38
   <xsl:choose>
insilmaril@207
    39
      <xsl:when test="/vymmap/mapcenter/heading">
insilmaril@207
    40
			
insilmaril@207
    41
				<xsl:variable name="title">
insilmaril@207
    42
				</xsl:variable>
insilmaril@207
    43
insilmaril@207
    44
        <xsl:value-of select="$title"/>
insilmaril@207
    45
      </xsl:when>
insilmaril@207
    46
      <xsl:otherwise></xsl:otherwise>
insilmaril@207
    47
   </xsl:choose>
insilmaril@207
    48
</xsl:variable>
insilmaril@207
    49
insilmaril@207
    50
insilmaril@207
    51
insilmaril@207
    52
insilmaril@207
    53
<!-- ======================================= -->
insilmaril@207
    54
<xsl:template match="*">
insilmaril@207
    55
   <xsl:message>
insilmaril@207
    56
      <xsl:text>WARNING: Unknown tag "</xsl:text>
insilmaril@207
    57
      <xsl:value-of select="local-name(.)"/>
insilmaril@207
    58
      <xsl:text>": </xsl:text>
insilmaril@207
    59
      <xsl:value-of select="normalize-space(.)"/>
insilmaril@207
    60
      <xsl:text>&#10;</xsl:text>
insilmaril@207
    61
   </xsl:message>
insilmaril@207
    62
</xsl:template>
insilmaril@207
    63
insilmaril@207
    64
insilmaril@207
    65
insilmaril@207
    66
insilmaril@207
    67
<xsl:template match="xbel">
insilmaril@321
    68
   <vymmap version="1.7.15" author="VYM - styles/kdebookmarks2vym.xsl" comment="" date="2006-04-24" backgroundColor="#ffffff" linkStyle="StylePolyLine" linkColor="#0000ff" defXLinkColor="#e6e6e6" defXLinkWidth="1">
insilmaril@207
    69
	<mapcenter>
insilmaril@207
    70
		<heading>Bookmarks</heading>
insilmaril@207
    71
		<branch frameType="Rectangle">
insilmaril@207
    72
			<heading>KDE</heading>
insilmaril@207
    73
				  <xsl:apply-templates/>
insilmaril@207
    74
		</branch>
insilmaril@207
    75
	</mapcenter>	
insilmaril@207
    76
   </vymmap>
insilmaril@207
    77
</xsl:template>
insilmaril@207
    78
insilmaril@207
    79
insilmaril@207
    80
<xsl:template match="folder">
insilmaril@207
    81
   <branch scrolled="yes">
insilmaril@207
    82
      <xsl:apply-templates/>
insilmaril@207
    83
   </branch>
insilmaril@207
    84
</xsl:template>
insilmaril@207
    85
insilmaril@207
    86
<xsl:template match="title">
insilmaril@207
    87
   <heading>
insilmaril@207
    88
      <xsl:apply-templates/>
insilmaril@207
    89
   </heading>
insilmaril@207
    90
</xsl:template>
insilmaril@207
    91
insilmaril@207
    92
<xsl:template match="separator">
insilmaril@207
    93
   <branch>
insilmaril@207
    94
		<heading>***************</heading>
insilmaril@207
    95
   </branch>
insilmaril@207
    96
</xsl:template>
insilmaril@207
    97
insilmaril@207
    98
<xsl:template match="desc">
insilmaril@207
    99
   <htmlnote fonthint="var">
insilmaril@207
   100
	<html>
insilmaril@207
   101
		<body style="font-size:10pt;font-family:Sans Serif">
insilmaril@207
   102
			<p>
insilmaril@207
   103
				<xsl:value-of select="." />
insilmaril@207
   104
			</p>
insilmaril@207
   105
		</body>
insilmaril@207
   106
	</html>
insilmaril@207
   107
insilmaril@207
   108
   </htmlnote>
insilmaril@207
   109
</xsl:template>
insilmaril@207
   110
insilmaril@207
   111
<xsl:template match="bookmark">
insilmaril@207
   112
   <branch>
insilmaril@207
   113
		<xsl:attribute name="url" ><xsl:value-of select="@href" />
insilmaril@207
   114
		</xsl:attribute>
insilmaril@207
   115
		<xsl:apply-templates/>
insilmaril@207
   116
   </branch>
insilmaril@207
   117
</xsl:template>
insilmaril@207
   118
insilmaril@207
   119
insilmaril@207
   120
<!-- Do nothing! We don't need some informational elements -->
insilmaril@207
   121
<xsl:template match="info*"/>
insilmaril@207
   122
insilmaril@207
   123
insilmaril@207
   124
</xsl:stylesheet>