易截截图软件、单文件、免安装、纯绿色、仅160KB

XML删除未含有条件的子节点

<power_line>
<name>嘉华305线 </name>
<sap_id>5020-S-0000-0065 </sap_id>
        <dydj>35kV </dydj>
<poles>
<pole>
<name>嘉华305线电缆电缆#0 </name>
<xh>0 </xh>
<sap_id>000000000040719166 </sap_id>
</pole>
<pole>
<name>嘉华305线电缆支架 </name>
<xh>0 </xh>
<sap_id>000000000040627384 </sap_id>
<jd>120.7071280158 </jd>
<wd>30.6240158394 </wd>
</pole>
<pole>
<name>嘉华305线电缆电缆#1 </name>
<xh>1 </xh>
<sap_id>000000000040716119 </sap_id>
</pole>
        </poles>
</power_line>


我想把不含有 <jd>的子节点都删除掉.请问要怎么做?

遍历 pole + 判断 删除...


或者:
C# code:
using System;
using System.Diagnostics;
using System.Xml;

namespace ConsoleApplication9 {
class Program {
static void Main() {
string xml = @"
<power_line>
<name>嘉华305线 </name>
<sap_id>50


相关问答:

数据表生成特定格式的xml - .NET技术 / ASP.NET

从数据库中查询一张表的数据
select 部门,姓名 from tb
如何才能生成下面的xml格式文件
<folder state="unchecked" label="全部">
  <folder state="unchecked" isBra ......

java xml文题 - Java / Java SE

<?xml version="1.0" encoding="utf-8" ?> 
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical&q ......

XML 的读写 - Web 开发 / XML/SOAP

<?xml version="1.0" encoding="utf-8" ?>
<HuiSin>
  <admin>100,100</admin>
  <user>200,200</user>
怎样在这里添加一个新的呢?
< ......

这个XML怎么读取 - .NET技术 / ASP.NET

远程读取
C# code:

XmlReader xmlReader = XmlReader.Create("http://google.com/complete/search?output=toolbar&q="+Keyword);
XML内容为
XML code:

<?xml version="1.0" ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号