处理xml的最有效方法 [英] Most efficient ways of manipulating xml

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

问题描述

我正在使用.net Framework 2.0.

我想知道
1)创建xml文档的有效方法,无论是使用xmldocument,xmlWriter还是XmlTextWriter来创建xml文档.

在2种情况下使用xmlReader,XmlTextReader,XPathNavigator,xmlDocument来读取xml文档.2)读取xml文档的有效方法.

在任何情况下都可以使用它们.

I am using .net framework 2.0.

I want to know
1) Efficient method for creating a xml document, whether to use xmldocument , xmlWriter or XmlTextWriter to 
     create a xml document. In what situation to use each one of them ?

2) Efficient method for reading a xml document whether to use xmlReader,XmlTextReader, XPathNavigator, xmlDocument to read xml document. In what situation to use each one of them ?

Any help will be greatly appriciated.

推荐答案

不能说哪一个是最多的效率高,因为我们不知道您会怎么做.也许您应该在自己的特定应用程序中衡量性能.

不过,我会再给您一个选择.如果您只需要保存自己的对象并将其读回,请使用系统. Xml.Serialization. XmlSerializer可将您的对象序列化为XML,然后从XML反序列化它们.
Cannot say which one is the most efficient, as we don't know what you do with it. Perhaps you should measure the performance within your own specific application.

I will give you one more option, though. If you just need to save your own objects and read them back, use System.Xml.Serialization.XmlSerializer to serialize your objects into XML and deserialize them back from XML.


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

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