- <root>
  <SG p_start="1" s_start="0" p_end="1" s_end="1" dom="q730e25" keywords="排名/晋级/预赛/比赛/半决赛/成绩/规则/奥运会/跳水" note="" /> 
  <SG p_start="2" s_start="0" p_end="2" s_end="0" dom="q730" keywords="战绩/名将/观众" note="本句群主题应是运动员与观众的关系,但目前q730中未设置这方面的延伸节点,暂放于概念树上。" /> 
  <SG p_start="2" s_start="1" p_end="2" s_end="1" dom="" keywords="" note="" /> 
  <SG p_start="2" s_start="2" p_end="2" s_end="2" dom="q730" keywords="代表团/奥运会/旗手" note="本句群主题是代表团与运动员" /> 
 
  </root>
对于上面的XML文件,怎么从中读取出keywords的内容,即最后得到的结果是:排名 晋级 预赛 比赛 半决赛 成绩 规则 奥运会 跳水 战绩 名将 观众 代表团 奥运会 旗手
谢谢了!

解决方案 »

  1.   

    参见我的BLOG
    http://blog.csdn.net/yumanqing/archive/2007/03/20/1534744.aspx
      

  2.   

    给你一段插入的代码,反过来就是
    try
    {
    XmlDocument doc=new XmlDocument();
    doc.Load(Application.StartupPath.Trim()+"\\DB\\playlist.xml");
    XmlNode node=doc.CreateElement("Item"); XmlAttribute xmlattr=doc.CreateAttribute("begintime");
    xmlattr.Value=XmlConvert.DecodeName(textBox2.Text);
    node.Attributes.Append(xmlattr); xmlattr=doc.CreateAttribute("playtime");
    xmlattr.Value=XmlConvert.DecodeName(textBox3.Text);
    node.Attributes.Append(xmlattr); xmlattr=doc.CreateAttribute("path");
    xmlattr.Value=XmlConvert.DecodeName(textBox1.Text);
    node.Attributes.Append(xmlattr); xmlattr=doc.CreateAttribute("notetime");
    xmlattr.Value=XmlConvert.DecodeName(DateTime.Now.ToString());
    node.Attributes.Append(xmlattr); doc.ChildNodes[0].AppendChild(node);
    doc.Save(Application.StartupPath.Trim()+"\\DB\\playlist.xml");
    }
      

  3.   

    http://community.csdn.net/Expert/topic/5284/5284674.xml?temp=.3703882