1<?xml version="1.0" encoding="UTF-8" ?>
2
3<!--
4        : This code released under the GPL.
5        : (http://www.gnu.org/copyleft/gpl.html)
6    Document   : mm2text.xsl
7    Created on : 01 February 2004, 17:17
8    Author     : joerg feuerhake joerg.feuerhake@free-penguin.org
9    Description: transforms freemind mm format to html, handles crossrefs and adds numbering. feel free to customize it while leaving the ancient authors
10                    mentioned. thank you
11    ChangeLog:
12
13    See: http://freemind.sourceforge.net/
14-->
15
16<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
17<xsl:output method="text"  indent="no" encoding="ISO-8859-1" />
18<xsl:key name="refid" match="node" use="@ID" />
19
20    <xsl:template match="/">
21        <xsl:text>#MindMapExport FreemindVersion:</xsl:text><xsl:value-of select="map/@version"/>
22        <xsl:text>&#xA;</xsl:text>
23        <xsl:text>&#xA;</xsl:text><xsl:apply-templates/>
24    </xsl:template>
25
26<xsl:template match="node">
27    <xsl:variable name="thisid" select="@ID"/>
28    <xsl:variable name="target" select="arrowlink/@DESTINATION"/>
29    <xsl:number level="multiple" count="node" format="1"/><xsl:text> </xsl:text><xsl:value-of select="@TEXT"/>
30        <xsl:if test="arrowlink/@DESTINATION != ''">
31            <xsl:text> (see:</xsl:text>
32            <xsl:for-each select="key('refid', $target)">
33                <xsl:value-of select="@TEXT"/>
34            </xsl:for-each>
35            <xsl:text>)</xsl:text>
36         </xsl:if>
37     <xsl:apply-templates/>
38</xsl:template>
39
40</xsl:stylesheet>
41