minor fixes in mmap2vym.xsl and repaired todo.vym (every includeImagesHor was set)
1 <?xml version="1.0" encoding="UTF-8"?>
4 Document : mmap2vym.xsl
5 Author : Clemens Kraus (http://www.clemens-kraus.de)
6 Uwe Drechsel <vym@InSilmaril.de>
8 Description: transforms exported MindManager-files (version x5/6) into vym-format.
9 Bugs : First Version, work still in progress!
10 Todo : - xlinks still to be implemented
11 - codes/symbols still to be implemented
12 - Multimap links (.mmap) still to be implemented
15 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
16 xmlns:xlink="http://www.w3.org/1999/xlink"
17 xmlns:ap="http://schemas.mindjet.com/MindManager/Application/2003"
18 xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl math func"
19 xmlns:math="http://exslt.org/math"
20 xmlns:func="http://exslt.org/functions"
23 <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
24 <xsl:param name="filenamep" />
25 <xsl:variable name="filename" select="$filenamep"/>
26 <!--<xsl:variable name="maxxCoord"><xsl:value-of select="math:max(map//xCoord)" /></xsl:variable>-->
29 <xsl:template match="/">
30 <xsl:element name="vymmap">
31 <!-- default settings: -->
32 <xsl:attribute name="comment">Generated with mmap2vym (V0.1.2) - MindManager to vym converter. More infos: www.clemens-kraus.de</xsl:attribute>
34 <xsl:variable name="author" select="concat(/ap:Map/ap:DocumentGroup/ap:Author/@UserName, ' ', /ap:Map/ap:DocumentGroup/ap:Author/@UserEmail)" />
35 <xsl:if test="$author">
36 <xsl:attribute name="author"><xsl:value-of select="$author"/></xsl:attribute>
39 <xsl:element name="mapcenter">
40 <!-- recurse to map title node ... -->
41 <xsl:apply-templates select="ap:Map/ap:OneTopic/ap:Topic/ap:Text"/>
42 <xsl:apply-templates select="ap:Map/ap:OneTopic/ap:Topic/ap:SubTopics" />
47 <xsl:template match="ap:Topic/ap:Text">
48 <xsl:element name="heading">
49 <xsl:value-of select="@PlainText" />
54 <xsl:template match="ap:Topic">
55 <xsl:element name="branch">
56 <xsl:call-template name="position" />
57 <!-- =============================== hyperlink ================================ -->
58 <xsl:variable name="url" select="ap:Hyperlink" />
60 <xsl:attribute name="url"><xsl:value-of select="ap:Hyperlink/@Url"/></xsl:attribute>
63 <xsl:variable name="rect" select="ap:SubTopicShape/@SubTopicShape" />
64 <xsl:if test="contains($rect, 'Rectangle')">
65 <xsl:attribute name="frameType">Rectangle</xsl:attribute>
67 <xsl:apply-templates/>
72 <!-- =============================== position ================================ -->
73 <xsl:template name="position">
74 <xsl:if test="ap:Offset/@CX!=''">
75 <xsl:attribute name="relPosX">
76 <xsl:value-of select="ap:Offset/@CX *3"/>
79 <xsl:if test="ap:Offset/@CY!=''">
80 <xsl:attribute name="relPosY">
81 <xsl:value-of select="floor( ap:Offset/@CY *3 )"/>
89 <!-- ================================= getfn ================================== -->
90 <!-- get the filename (without the path) -->
92 <xsl:template name="getfn">
93 <xsl:param name="txt" select="." />
95 <xsl:when test="contains($txt, '/')" >
96 <xsl:variable name="right" select="substring-after($txt, '/')" />
97 <xsl:if test="string-length($right)>1" >
98 <xsl:call-template name="getfn" >
99 <xsl:with-param name="txt" select="$right" />
104 <xsl:value-of select="$txt" />
110 <!-- =============================== Icons ================================ -->
111 <xsl:template match="ap:Icon">
112 <xsl:element name="standardFlag">
114 <xsl:when test="@IconType ='urn:mindjet:ExclamationMark'">exclamationmark</xsl:when>
115 <xsl:when test="@IconType ='urn:mindjet:SmileyHappy'">smiley-good</xsl:when>
116 <xsl:when test="@IconType ='urn:mindjet:SmileySad'">smiley-sad</xsl:when>
118 <xsl:message>Unknown Flag found: <xsl:value-of select="@IconType"/></xsl:message>
125 <!-- =============================== color ================================ -->
126 <xsl:template match="color">
127 <xsl:attribute name="textColor">
128 <!-- switch from BBGGRR to #RRGGBB representation -->
129 <xsl:text>#</xsl:text>
130 <xsl:value-of select="substring( ., 5, 2 )"/>
131 <xsl:value-of select="substring( ., 3, 2 )"/>
132 <xsl:value-of select="substring( ., 1, 2 )"/>