如何遍历xml文件 [英] how to traverse xml file

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

问题描述

如何遍历xml文件?我必须通过查找适当的节点来插入或更新记录,如果它是新记录集,例如app,module,table,cloumn.然后,它必须添加xml文件,或者如果所有记录都具有相同的数据但有一个新列,则在同一应用程序,相同的模块,相同的表中应添加新的列.那么,该怎么做?请告诉我.

How to traverse an xml file? I have to insert or update a record by finding with the appropriate node if it is the new set of records like app,module,table,cloumn. Then it has to add in the xml file or if all the records having the same data but one new column is there then with in that same app,same module,same table that new column should be added. So, how to do that one? Please tell me.

推荐答案

如果精确地需要遍历",则绝对最佳的方法是System.Xml.XmlReader.是否要操纵数据,简单而不是最佳性能,使用DOM会更容易,请参见类System.Xml.XmlReader.

请参阅有关该主题和示例的Microsoft帮助;请参阅Microsoft帮助.他们足够清楚.

—SA
If "traverse" is what you need precisely, the absolutely best way to do is System.Xml.XmlReader. Is you want manipulation of the data, simplicity and not the best performance, using DOM will be easier, see the class System.Xml.XmlReader.

Please see Microsoft help on the topic and the samples; they are clear enough.

—SA


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

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