65.9K
CodeProject is changing. Read more.
Home

Converting Mind Map Plan into an Excel Table

emptyStarIconemptyStarIconemptyStarIconemptyStarIconemptyStarIcon

0/5 (0 vote)

May 25, 2011

CPOL
viewsIcon

27126

Converting Mind Map Plan into an Excel Table

I am a big fan of mind mapping. Especially for planning. When someone asks me to give an estimation for some piece of work, I split it in sub tasks. If I can't predict the particular sub task effort, I just continue splitting until I'm confident. I prefer estimating in days.

I use FreeMind. It's an open source cross platform solution that has everything I need for planning.

Here is a sample plan:

figure1.png

So, the numbers show my estimations and the ticks represent the status (complete). Now I want this to be more presentable for a manager. I was too lazy to fill the Excel spreadsheet manually, so I tried to find some options in FreeMind. And that's what I've found:

figure2.png

There is an XSLT export. I'm not a big fan of XSLT, but this seamed to be the right solution. I've spent some time hacking, and here is my XSLT:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
    <xsl:output method="xml" indent="no"/>
    <xsl:template match="/">      
      <xsl:processing-instruction name="mso-application">
        <xsl:text>progid="Word.Document"</xsl:text>
      </xsl:processing-instruction>
        <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
           xmlns:o="urn:schemas-microsoft-com:office:office"
           xmlns:x="urn:schemas-microsoft-com:office:excel"
           xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
           xmlns:html="http://www.w3.org/TR/REC-html40">          
            <Worksheet ss:Name="{/map/node[1]/@TEXT}">
                <Table>
                    <Row>
                        <Cell>
                            <Data ss:Type="String">Task</Data>
                        </Cell>
                        <Cell>
                            <Data ss:Type="String">Estimation</Data>
                        </Cell>
                        <Cell>
                            <Data ss:Type="String">Status</Data>
                        </Cell>
                    </Row>
                    <xsl:for-each select="//node[count
			(child::icon[starts-with(@BUILTIN, 'full-')]) > 0]">
                        <Row>
                            <Cell>
                                <Data ss:Type="String">
                                    <xsl:for-each select="ancestor-or-self::node
					[count(ancestor::*) > 1]">
                                        <xsl:value-of select="@TEXT"/>. </xsl:for-each>
                                </Data>
                            </Cell>
                            <Cell>
                                <xsl:attribute name="ss:Formula">
                                    =
                                <xsl:for-each select="child::icon
				[starts-with(@BUILTIN, 'full-')]">
                                    <xsl:value-of select="substring-after
				(@BUILTIN, '-')"/>+
                                </xsl:for-each>0</xsl:attribute>
                                <Data ss:Type="Number"></Data>
                            </Cell>
                            <Cell>
                                <Data ss:Type="String">
                                  <xsl:choose>
                                    <xsl:when test="child::icon[@BUILTIN = 'button_ok']">
                                        Complete
                                    </xsl:when>
                                    <xsl:otherwise>NotStarted</xsl:otherwise>
                                  </xsl:choose>                                  
                                </Data>
                            </Cell>
                        </Row>
                        <xsl:apply-templates/>
                    </xsl:for-each>
                </Table>
            </Worksheet>
        </Workbook>        
    </xsl:template>    
</xsl:stylesheet>

This turns the previous map into this:

figure3.png

Formatting is done manually, but I will add this to XSLT in future. But currently, it suits me.