insilmaril@218
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
insilmaril@217
|
2 |
|
insilmaril@217
|
3 |
<!--
|
insilmaril@217
|
4 |
Document : mmap2vym.xsl
|
insilmaril@217
|
5 |
Author : Clemens Kraus (http://www.clemens-kraus.de)
|
insilmaril@219
|
6 |
Uwe Drechsel <vym@InSilmaril.de>
|
insilmaril@217
|
7 |
|
insilmaril@217
|
8 |
Description: transforms exported MindManager-files (version x5/6) into vym-format.
|
insilmaril@217
|
9 |
Bugs : First Version, work still in progress!
|
insilmaril@217
|
10 |
Todo : - xlinks still to be implemented
|
insilmaril@217
|
11 |
- codes/symbols still to be implemented
|
insilmaril@219
|
12 |
- Multimap links (.mmap) still to be implemented
|
insilmaril@217
|
13 |
-->
|
insilmaril@217
|
14 |
|
insilmaril@217
|
15 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
insilmaril@217
|
16 |
xmlns:xlink="http://www.w3.org/1999/xlink"
|
insilmaril@219
|
17 |
xmlns:ap="http://schemas.mindjet.com/MindManager/Application/2003"
|
insilmaril@217
|
18 |
xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl math func"
|
insilmaril@217
|
19 |
xmlns:math="http://exslt.org/math"
|
insilmaril@217
|
20 |
xmlns:func="http://exslt.org/functions"
|
insilmaril@217
|
21 |
version="1.0">
|
insilmaril@217
|
22 |
|
insilmaril@217
|
23 |
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
|
insilmaril@219
|
24 |
<xsl:param name="filenamep" />
|
insilmaril@219
|
25 |
<xsl:variable name="filename" select="$filenamep"/>
|
insilmaril@219
|
26 |
<!--<xsl:variable name="maxxCoord"><xsl:value-of select="math:max(map//xCoord)" /></xsl:variable>-->
|
insilmaril@217
|
27 |
|
insilmaril@219
|
28 |
<!-- root element -->
|
insilmaril@219
|
29 |
<xsl:template match="/">
|
insilmaril@219
|
30 |
<xsl:element name="vymmap">
|
insilmaril@219
|
31 |
<!-- default settings: -->
|
insilmaril@219
|
32 |
<xsl:attribute name="comment">Generated with mmap2vym (V0.1.2) - MindManager to vym converter. More infos: www.clemens-kraus.de</xsl:attribute>
|
insilmaril@217
|
33 |
|
insilmaril@219
|
34 |
<xsl:variable name="author" select="concat(/ap:Map/ap:DocumentGroup/ap:Author/@UserName, ' ', /ap:Map/ap:DocumentGroup/ap:Author/@UserEmail)" />
|
insilmaril@219
|
35 |
<xsl:if test="$author">
|
insilmaril@219
|
36 |
<xsl:attribute name="author"><xsl:value-of select="$author"/></xsl:attribute>
|
insilmaril@219
|
37 |
</xsl:if>
|
insilmaril@219
|
38 |
|
insilmaril@219
|
39 |
<xsl:element name="mapcenter">
|
insilmaril@219
|
40 |
<!-- recurse to map title node ... -->
|
insilmaril@219
|
41 |
<xsl:apply-templates select="ap:Map/ap:OneTopic/ap:Topic/ap:Text"/>
|
insilmaril@219
|
42 |
<xsl:apply-templates select="ap:Map/ap:OneTopic/ap:Topic/ap:SubTopics" />
|
insilmaril@219
|
43 |
</xsl:element>
|
insilmaril@219
|
44 |
</xsl:element>
|
insilmaril@219
|
45 |
</xsl:template>
|
insilmaril@217
|
46 |
|
insilmaril@219
|
47 |
<xsl:template match="ap:Topic/ap:Text">
|
insilmaril@219
|
48 |
<xsl:element name="heading">
|
insilmaril@219
|
49 |
<xsl:value-of select="@PlainText" />
|
insilmaril@219
|
50 |
</xsl:element>
|
insilmaril@219
|
51 |
</xsl:template>
|
insilmaril@217
|
52 |
|
insilmaril@217
|
53 |
|
insilmaril@219
|
54 |
<xsl:template match="ap:Topic">
|
insilmaril@219
|
55 |
<xsl:element name="branch">
|
insilmaril@219
|
56 |
<xsl:call-template name="position" />
|
insilmaril@219
|
57 |
<!-- =============================== hyperlink ================================ -->
|
insilmaril@219
|
58 |
<xsl:variable name="url" select="ap:Hyperlink" />
|
insilmaril@219
|
59 |
<xsl:if test="$url">
|
insilmaril@219
|
60 |
<xsl:attribute name="url"><xsl:value-of select="ap:Hyperlink/@Url"/></xsl:attribute>
|
insilmaril@219
|
61 |
</xsl:if>
|
insilmaril@217
|
62 |
|
insilmaril@219
|
63 |
<xsl:variable name="rect" select="ap:SubTopicShape/@SubTopicShape" />
|
insilmaril@219
|
64 |
<xsl:if test="contains($rect, 'Rectangle')">
|
insilmaril@219
|
65 |
<xsl:attribute name="frameType">Rectangle</xsl:attribute>
|
insilmaril@219
|
66 |
</xsl:if>
|
insilmaril@219
|
67 |
<xsl:apply-templates/>
|
insilmaril@219
|
68 |
</xsl:element>
|
insilmaril@219
|
69 |
</xsl:template>
|
insilmaril@217
|
70 |
|
insilmaril@217
|
71 |
|
insilmaril@219
|
72 |
<!-- =============================== position ================================ -->
|
insilmaril@219
|
73 |
<xsl:template name="position">
|
insilmaril@218
|
74 |
<xsl:if test="ap:Offset/@CX!=''">
|
insilmaril@218
|
75 |
<xsl:attribute name="relPosX">
|
insilmaril@219
|
76 |
<xsl:value-of select="ap:Offset/@CX *3"/>
|
insilmaril@218
|
77 |
</xsl:attribute>
|
insilmaril@218
|
78 |
</xsl:if>
|
insilmaril@218
|
79 |
<xsl:if test="ap:Offset/@CY!=''">
|
insilmaril@218
|
80 |
<xsl:attribute name="relPosY">
|
insilmaril@218
|
81 |
<xsl:value-of select="floor( ap:Offset/@CY *3 )"/>
|
insilmaril@218
|
82 |
</xsl:attribute>
|
insilmaril@218
|
83 |
</xsl:if>
|
insilmaril@219
|
84 |
</xsl:template>
|
insilmaril@217
|
85 |
|
insilmaril@217
|
86 |
|
insilmaril@217
|
87 |
|
insilmaril@217
|
88 |
|
insilmaril@217
|
89 |
<!-- ================================= getfn ================================== -->
|
insilmaril@217
|
90 |
<!-- get the filename (without the path) -->
|
insilmaril@217
|
91 |
|
insilmaril@217
|
92 |
<xsl:template name="getfn">
|
insilmaril@217
|
93 |
<xsl:param name="txt" select="." />
|
insilmaril@217
|
94 |
<xsl:choose>
|
insilmaril@217
|
95 |
<xsl:when test="contains($txt, '/')" >
|
insilmaril@217
|
96 |
<xsl:variable name="right" select="substring-after($txt, '/')" />
|
insilmaril@217
|
97 |
<xsl:if test="string-length($right)>1" >
|
insilmaril@217
|
98 |
<xsl:call-template name="getfn" >
|
insilmaril@217
|
99 |
<xsl:with-param name="txt" select="$right" />
|
insilmaril@217
|
100 |
</xsl:call-template>
|
insilmaril@217
|
101 |
</xsl:if>
|
insilmaril@217
|
102 |
</xsl:when>
|
insilmaril@217
|
103 |
<xsl:otherwise>
|
insilmaril@217
|
104 |
<xsl:value-of select="$txt" />
|
insilmaril@217
|
105 |
</xsl:otherwise>
|
insilmaril@217
|
106 |
</xsl:choose>
|
insilmaril@217
|
107 |
|
insilmaril@217
|
108 |
</xsl:template>
|
insilmaril@217
|
109 |
|
insilmaril@218
|
110 |
<!-- =============================== Icons ================================ -->
|
insilmaril@218
|
111 |
<xsl:template match="ap:Icon">
|
insilmaril@218
|
112 |
<xsl:element name="standardFlag">
|
insilmaril@219
|
113 |
<xsl:choose>
|
insilmaril@219
|
114 |
<xsl:when test="@IconType ='urn:mindjet:ExclamationMark'">exclamationmark</xsl:when>
|
insilmaril@219
|
115 |
<xsl:when test="@IconType ='urn:mindjet:SmileyHappy'">smiley-good</xsl:when>
|
insilmaril@219
|
116 |
<xsl:when test="@IconType ='urn:mindjet:SmileySad'">smiley-sad</xsl:when>
|
insilmaril@219
|
117 |
<xsl:otherwise>
|
insilmaril@219
|
118 |
<xsl:message>Unknown Flag found: <xsl:value-of select="@IconType"/></xsl:message>
|
insilmaril@219
|
119 |
</xsl:otherwise>
|
insilmaril@219
|
120 |
</xsl:choose>
|
insilmaril@218
|
121 |
</xsl:element>
|
insilmaril@218
|
122 |
</xsl:template>
|
insilmaril@218
|
123 |
|
insilmaril@217
|
124 |
|
insilmaril@217
|
125 |
<!-- =============================== color ================================ -->
|
insilmaril@217
|
126 |
<xsl:template match="color">
|
insilmaril@217
|
127 |
<xsl:attribute name="textColor">
|
insilmaril@217
|
128 |
<!-- switch from BBGGRR to #RRGGBB representation -->
|
insilmaril@217
|
129 |
<xsl:text>#</xsl:text>
|
insilmaril@217
|
130 |
<xsl:value-of select="substring( ., 5, 2 )"/>
|
insilmaril@217
|
131 |
<xsl:value-of select="substring( ., 3, 2 )"/>
|
insilmaril@217
|
132 |
<xsl:value-of select="substring( ., 1, 2 )"/>
|
insilmaril@217
|
133 |
</xsl:attribute>
|
insilmaril@217
|
134 |
</xsl:template>
|
insilmaril@217
|
135 |
|
insilmaril@217
|
136 |
|
insilmaril@217
|
137 |
</xsl:stylesheet>
|
insilmaril@217
|
138 |
|
insilmaril@217
|
139 |
|