我的xml文件
<?xml version="1.0" encoding="utf-8" ?>
<document>
<record>
<name>kjdfkj</name>
<date>2003-12-6 3:27:18</date>
<body>
帖子内容
内容是以过滤html等于xml文件规范相冲突的字符以后的合法内容,标题也需要过滤
</body>
</record>
<record>
<name>kdfj</name>
<date>2010-7-9 23:07:23</date>
<body>
jsdjfaldj觉得佛二级附近的了看法
</body>
</record>
</document>
<?xml version="1.0" encoding="utf-8" ?>
<document>
<record>
<name>kjdfkj</name>
<date>2003-12-6 3:27:18</date>
<body>
帖子内容
内容是以过滤html等于xml文件规范相冲突的字符以后的合法内容,标题也需要过滤
</body>
</record>
<record>
<name>kdfj</name>
<date>2010-7-9 23:07:23</date>
<body>
jsdjfaldj觉得佛二级附近的了看法
</body>
</record>
</document>
doc.Load("");
XmlNode no= doc.SelectSingleNode("//Root/Item[@ID='']");
if(no!=null)
{
XmlElement xe=(XmlElement)no;
xe.RemoveAll();
}
RemoveAll();//删除该节点的全部内容