Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / productivity / Office / MS-Excel

Converting Mind Map Plan into an Excel Table

0.00/5 (No votes)
25 May 2011CPOL 27.1K  
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
<?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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)