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

查看:36
本文介绍了如何在 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/en-us/library/system.xml.xmlreader.aspx

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

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