处理xml文件 [英] manipulating xml document

查看:92
本文介绍了处理xml文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试操纵SOAP响应.
基本上,我是来自其他一些方面的SOAP响应,在将响应插入数据库之前,我需要执行以下操作:
1.删​​除"_"
2.如果智利节点中的所有文本均为空,则从xml中删除父节点.
3.并删除空格

我应该使用XDocument.我遇到的主要问题是:
我们不知道节点的名称是什么,所以我无法在节点的名称上name悔

有什么建议吗?.

谢谢
V.

Hi,

I am trying to manipulate SOAP response.
Basically i a SOAP Response from some other parties, and before inserting the response into database i have do following:
1. remove ''_''
2. if all of the text in chile nodes is empty, then remove the parent node from xml.
3. and remove spaces

i should use XDocument. The main problem i have is:
we dont know what are the names of the node, so i couldn''t depent on node''s name

any suggestions..?

Thank you
V.

推荐答案

如果将平台定位到C#4.0,则可以使用 ^ ].

通过LINQ to XML,查询 [
If you target the platform to C# 4.0, you can use the power of LINQ to XML[^].

Via LINQ to XML it is very easy to query[^] in XML documents and find the info you need.


这篇关于处理xml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆