xml文件内容如下:<?xml version="1.0" encoding="GB2312"?>
<soft version="2.0">
<chapter>
<type>C#技术资料</type>
<item>
<title>c#读写数据库操作类 </title>
<id>1</id>
<from>不知道</from>
<time>2009-1-11</time>
<content>男 </content>
</item>
<item>
<title>利用c#打造游戏</title>
<id>2</id>
<from>不知道</from>
<time>2009-1-11</time>
<content>女 </content>
</item>
</chapter>
<chapter>
<type>xml文档操作</type>
<item>
<title>c#操作xml类</title>
<id>1</id>
<from>不知道</from>
<time>2009-1-11</time>
<content>男 </content>
</item>
<item>
<title>xml各种操作(c#版)</title>
<id>2</id>
<from>不知道</from>
<time>2009-1-11</time>
<content>女 </content>
</item>
</chapter>
<chapter>
<type>asp.net站点制作</type>
</chapter>
<chapter>
<type>SQL数据库文章</type>
</chapter>
<chapter>
<type>DIV+CSS精华</type>
</chapter>
<chapter>
<type>C#高级编程知识</type>
</chapter>
</soft>
我现在想删除<chapter>
<type>C#技术资料</type>
<item>
<title>c#读写数据库操作类 </title>
<id>1</id>
<from>不知道</from>
<time>2009-1-11</time>
<content>男 </content>
</item>
<item>
<title>利用c#打造游戏</title>
<id>2</id>
<from>不知道</from>
<time>2009-1-11</time>
<content>女 </content>
</item>
</chapter>也就是整个chapter节点,该如何来做,高手指教下,谢谢
<soft version="2.0">
<chapter>
<type>C#技术资料</type>
<item>
<title>c#读写数据库操作类 </title>
<id>1</id>
<from>不知道</from>
<time>2009-1-11</time>
<content>男 </content>
</item>
<item>
<title>利用c#打造游戏</title>
<id>2</id>
<from>不知道</from>
<time>2009-1-11</time>
<content>女 </content>
</item>
</chapter>
<chapter>
<type>xml文档操作</type>
<item>
<title>c#操作xml类</title>
<id>1</id>
<from>不知道</from>
<time>2009-1-11</time>
<content>男 </content>
</item>
<item>
<title>xml各种操作(c#版)</title>
<id>2</id>
<from>不知道</from>
<time>2009-1-11</time>
<content>女 </content>
</item>
</chapter>
<chapter>
<type>asp.net站点制作</type>
</chapter>
<chapter>
<type>SQL数据库文章</type>
</chapter>
<chapter>
<type>DIV+CSS精华</type>
</chapter>
<chapter>
<type>C#高级编程知识</type>
</chapter>
</soft>
我现在想删除<chapter>
<type>C#技术资料</type>
<item>
<title>c#读写数据库操作类 </title>
<id>1</id>
<from>不知道</from>
<time>2009-1-11</time>
<content>男 </content>
</item>
<item>
<title>利用c#打造游戏</title>
<id>2</id>
<from>不知道</from>
<time>2009-1-11</time>
<content>女 </content>
</item>
</chapter>也就是整个chapter节点,该如何来做,高手指教下,谢谢
解决方案 »
- 怎么给文本框输入的数字,加上双引号。
- 求一篇关于 项目中Ext的实现及研究的论文
- 急!找不到类型或命名空间名称“DataContractAttribute”?
- 做过条码 pos的请进来
- 有没有人知道调用adobe的那个控件可以实现pdf文件的搜索功能和关键字的高亮显示!翘首期盼高手解答!
- 怎样访问“计算机管理”里的“本地用户和组”
- 各位XDJM请多多指教
- 关于enum 类型,有没有更加好保存值到文件的方法呢.
- c#的字体风格FontStyle为什么不能同时是bold,italic??
- C#下载,如何循环获取文件信息
- c#在listview中单击listitem或空白处的区别?
- 百人难遇的问题?
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(filename);
XmlNodeList xn0 = xmlDoc.SelectSingleNode("soft").ChildNodes;
xn0[0].RemoveAll();