An XMind file is actually an archived package of several XML files and other attachments compressed using general ZIP algorithm. An XMind archive may contain the following components:
- content.xml: (required) main data and hierarchy
- styles.xml: style information
- meta.xml: meta information
- META-INF/: meta folder
- manifest.xml: (required) the manifest of this archive
- attachments/: attachment folder, used to store attached files
- markers/: markers folder, used to store custom markers
- Thumbnails/: thumbnail folder, used to store preview image of this workbook
- thumbnail.jpg: the preview image
The content.xml contains main data and hierarchy of this xmind file. The struct of content.xml is as following,
The major elements is topic elements. A topic element represents a topic in a mind map. A topic may have subtopics (or none), but has only one parent (or none). In view of this, the best method of visiting attribute is Depth First Search algorithm.
Save the following code into file. Now, you can run
go run widget.go to convert xmind to markdown file.