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