如何在C#中解析非常大的XML文件? [英] How to parse very huge XML Files in C#?

查看:138
本文介绍了如何在C#中解析非常大的XML文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用dblp XML文件.我实际上想解析dblp.xml文件,并想提取有用的信息,以便在某些项目中进行进一步处理.而且该XML文件非常大(1.1 GB),我什至无法打开该文件.

I am working with dblp XML files. I actually want to parse the dblp.xml file and want to extract the usefull information for my further processing in some project. And that XML File is very huge (1.1 GB) and I am unable to even open this file.

如果您有用于dblp.xml的C#解析器,或者可以就此进行指导,或者有关如何解析巨大的xml文件,请指导我.

Kindly guide me if you have C# parser for dblp.xml or you can guide me regarding this, or about how can we parse huge xml files.

推荐答案

使用XML阅读器而不是XML dom. XML dom将整个文件存储在内存中,这完全没用:

Use XML reader instead of XML dom. XML dom stores the whole file in memory which is totally useless:

http://msdn.microsoft.com/zh- us/library/system.xml.xmlreader.aspx

这篇关于如何在C#中解析非常大的XML文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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