Freeplane 是一款基于 Java 的开源软件,继承 Freemind 的思维导图工具软件,它扩展了知识管理功能,在 Freemind 上增加了一些额外的功能,比如数学公式、节点属性面板等。
先写一个测试程序 test_read_Xml.cs 如下
using System;
using System.IO;
using System.Text;
using System.Xml;
namespace Test
{
public class ReadXml
{
static void Main(string[] args)
{
if (args.Length <1){
Console.WriteLine(" usage: test_read_Xml.exe your_file.mm ");
return;
}
if (! File.Exists(args[0])){
Console.WriteLine("Error: {0} not exists.", args[0]);
return;
}
if (Path.GetExtension(args[0]) != ".mm"){
Console.WriteLine("Tip: can only read file.mm");
}
string path1 = args[0]; // your_mm_file_path
//定义几个变量
string xt,zd1,zd2,zd3,zd4,zd5;
zd5 ="";
// 初始化一个 xmldoc实例
XmlDocument xml = new XmlDocument();
//XmlNodeList list1,list2,list3;
// 导入指定的 xml文件
xml.Load(path1);
// 指定root节点
XmlNode root = xml.SelectSingleNode("/map/node");
xt = root.Attributes["TEXT"].Value;
Console.WriteLine(xt);
if (root.HasChildNodes){
// 获取该节点下所有直接子节点
//list1 = root.ChildNodes;
foreach( XmlNode node1 in root.ChildNodes){
if (node1.Name =="node"){
zd1 = node1.Attributes["TEXT"].Value;
//Console.WriteLine(" "+