一个轻量级的XML解析器对大文件有效吗? [英] A lightweight XML parser efficient for large files?

查看:136
本文介绍了一个轻量级的XML解析器对大文件有效吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要解析潜在的巨大的XML文件,所以我想这规定DOM解析器。

I need to parse potentially huge XML files, so I guess this rules out DOM parsers.

有没有任何良好的轻量级SAX解析器为C ++,可以与TinyXML在足迹?
XML的结构非常简单,不需要像命名空间和DTD这样的高级功能。只要元素,属性和cdata。

Is out there any good lightweight SAX parser for C++, comparable with TinyXML on footprint? The structure of XML is very simple, no advanced things like namespaces and DTDs are needed. Just elements, attributes and cdata.

我知道Xerces,但它的超过50mb的大小让我震惊。

I know about Xerces, but its sheer size of over 50mb gives me shivers.

谢谢!

推荐答案

如果您使用C,则可以使用 Gnome 项目中的.xmlsoft.org /rel =nofollow> LibXML 。您可以从文档中选择DOM和SAX界面,还可以选择多年来开发的许多其他功能。如果你真的想要C ++,那么你可以使用 libxml ++ ,这是一个围绕LibXML的C ++ OO包装器。

If you are using C, then you can use LibXML from the Gnome project. You can choose from DOM and SAX interfaces to your document, plus lots of additional features that have been developed over years. If you really want C++, then you can use libxml++, which is a C++ OO wrapper around LibXML.

库已经被证明一次又一次,是高性能的,可以在几乎任何平台上编译你可以找到。

The library has been proven again and again, is high performance, and can be compiled on almost any platform you can find.

这篇关于一个轻量级的XML解析器对大文件有效吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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