问题描述
我有一个xml文档
sample.xml
<cities>
<id>1<id>
<country>India</country>
<city>Mumbai</city>
</cities>
<cities>
<id>2<id>
<country>US</country>
<city>California</city>
</cities>
<cities>
<id>3<id>
<country>India</country>
<city>New Delhi</city>
</cities>
我想在ID上执行搜索,并且根据ID我只想获取一个元素。 例如: 如果我搜索id = 1我想要
<cities>
<id>1<id>
<country>India</country>
<city>Mumbai</city>
</cities>
只将其退回
如果城市是不同xml的一部分,这将很容易,我很容易做到
元素值查询
关于如何将所有城市仅作为一个xml的一部分来解决这个问题的任何建议?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)