| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 890 人关注过本帖
标题:读取XML问题
只看楼主 加入收藏
lmyh5201
Rank: 1
等 级:新手上路
帖 子:241
专家分:0
注 册:2007-3-29
结帖率:100%
收藏
 问题点数:0 回复次数:2 
读取XML问题
<one value="100" text="北京">
    <two value="101" text="昌平">
      <three value="102" text="昌平">
      </three>
    </two>
    <two value="103" text="朝阳">
      <three value="104" text="朝阳">
      </three>
    </two>
    <two value="105" text="崇文">
      <three value="106" text="崇文">
      </three>
    </two>
    <two value="107" text="大兴">
      <three value="108" text="大兴">
      </three>
    </two>
    <two value="109" text="东城">
      <three value="110" text="东城">
      </three>
    </two>
    <two value="111" text="房山">
      <three value="112" text="房山">
      </three>
    </two>
    <two value="113" text="丰台">
      <three value="114" text="丰台">
      </three>
    </two>
    <two value="115" text="海淀">
      <three value="116" text="海淀">
      </three>
    </two>
    <two value="117" text="怀柔">
      <three value="118" text="怀柔">
      </three>
    </two>
    <two value="119" text="门头沟">
      <three value="120" text="门头沟">
      </three>
    </two>
    <two value="121" text="密云">
      <three value="122" text="密云">
      </three>
    </two>
    <two value="123" text="平谷">
      <three value="124" text="平谷">
      </three>
    </two>
    <two value="125" text="石景山">
      <three value="126" text="石景山">
      </three>
    </two>
    <two value="127" text="顺义">
      <three value="128" text="顺义">
      </three>
    </two>
    <two value="129" text="通州">
      <three value="130" text="通州">
      </three>
    </two>
    <two value="131" text="西城">
      <three value="132" text="西城">
      </three>
    </two>
    <two value="133" text="宣武">
      <three value="134" text="宣武">
      </three>
    </two>
    <two value="135" text="延庆">
      <three value="136" text="延庆">
      </three>
    </two>
  </one>

怎么根据传过来的值来读取出<two>里的内容阿,不要<three>里的,不要用JS写
搜索更多相关主题的帖子: XML 
2008-10-27 15:29
铲铲
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:34
帖 子:506
专家分:0
注 册:2006-5-2
收藏
得分:0 
XmlDocument doc = new XmlDocument();
doc.ReadXml("你上面的那一堆");
doc.ChildNodes[0].ChildNodes 这个集合即使two的集合。

铲铲是也
2008-10-27 16:05
fly_yan
Rank: 1
等 级:新手上路
帖 子:71
专家分:0
注 册:2008-10-10
收藏
得分:0 
DataTable dt
chatHis.ReadXml("你的xml的文件路径");
返回类型一个表格
2008-10-29 16:26
快速回复:读取XML问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014602 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved