什么是C ++最好的开放XML解析器? [英] What is the best open XML parser for C++?

查看:156
本文介绍了什么是C ++最好的开放XML解析器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找一个简单,干净,正确的XML解析器,在我的C ++项目中使用。我应该自己写吗?

解决方案

RapidXML ? RapidXML是一个用C ++编写的非常快速和小的XML DOM解析器。它主要针对嵌入式环境,计算机游戏或任何其他可用内存或CPU处理能力非常昂贵的应用程序。 RapidXML是根据Boost软件许可证授权的,其源代码是免费提供的。



功能




  • 解析速度(包括DOM树
    建立)接近速度

    上执行的strlen函数相同的数据。

  • 在现代CPU(截至2008年),
    解析器的吞吐量约为10亿
    字符/秒。请参阅
    在线
    手册中的性能部分。

  • 代码
    的小内存空间和创建的DOM树。


  • 简单的许可证允许使用
    几乎任何目的,包括商业化的

  • 支持UTF-8和部分UTF-16,
    UTF-32编码。

  • 没有
    的可移植源代码,而非C ++标准库的非常小的
    子集。

  • 此子集非常小,可以$ b $
  • p>


    • 解析器忽略DOCTYPE
      声明。

    • 不支持XML命名空间。

    • 解析器不检查
      字符的有效性。

    • 解析器的界面没有
      符合DOM规范。

    • 解析器不检查
      属性的唯一性。



    资料来源: wikipedia.org://Rapidxml






    根据您的使用情况,您可以使用XML数据绑定? CodeSynthesis XSD 是由Code Synthesis和双授权开发的C ++的XML数据绑定编译器根据GNU GPL和专有许可证。给定一个XML实例规范(XML Schema),它生成代表给定词汇以及解析和序列化代码的C ++类。



    CodeSynthesis XSD的一个独特功能它支持两种不同的XML Schema到C ++映射:内存C ++ / Tree和面向流的C ++ / Parser。 C ++ / Tree映射是一种具有树状,内存中数据结构的传统映射。 C ++ / Parser是一种新的类似SAX的映射,它将存储在XML实例文档中的信息表示为词汇特定解析事件的层次结构。与C ++ / Tree相比,C ++ / Parser映射允许处理不适合内存的大型XML文档,执行面向流的处理或使用现有的内存表示。



    资料来源: wikipedia.org://CodeSynthesis XSD


    I am looking for a simple, clean, correct XML parser to use in my C++ project. Should I write my own?

    解决方案

    How about RapidXML? RapidXML is a very fast and small XML DOM parser written in C++. It is aimed primarily at embedded environments, computer games, or any other applications where available memory or CPU processing power comes at a premium. RapidXML is licensed under Boost Software License and its source code is freely available.

    Features

    • Parsing speed (including DOM tree building) approaching speed of strlen function executed on the same data.
    • On a modern CPU (as of 2008) the parser throughput is about 1 billion characters per second. See Performance section in the Online Manual.
    • Small memory footprint of the code and created DOM trees.
    • A headers-only implementation, simplifying the integration process.
    • Simple license that allows use for almost any purpose, both commercial and non-commercial, without any obligations.
    • Supports UTF-8 and partially UTF-16, UTF-32 encodings.
    • Portable source code with no dependencies other than a very small subset of C++ Standard Library.
    • This subset is so small that it can be easily emulated manually if use of standard library is undesired.

    Limitations

    • The parser ignores DOCTYPE declarations.
    • There is no support for XML namespaces.
    • The parser does not check for character validity.
    • The interface of the parser does not conform to DOM specification.
    • The parser does not check for attribute uniqueness.

    Source: wikipedia.org://Rapidxml


    Depending on you use, you may use an XML Data Binding? CodeSynthesis XSD is an XML Data Binding compiler for C++ developed by Code Synthesis and dual-licensed under the GNU GPL and a proprietary license. Given an XML instance specification (XML Schema), it generates C++ classes that represent the given vocabulary as well as parsing and serialization code.

    One of the unique features of CodeSynthesis XSD is its support for two different XML Schema to C++ mappings: in-memory C++/Tree and stream-oriented C++/Parser. The C++/Tree mapping is a traditional mapping with a tree-like, in-memory data structure. C++/Parser is a new, SAX-like mapping which represents the information stored in XML instance documents as a hierarchy of vocabulary-specific parsing events. In comparison to C++/Tree, the C++/Parser mapping allows one to handle large XML documents that would not fit in memory, perform stream-oriented processing, or use an existing in-memory representation.

    Source: wikipedia.org://CodeSynthesis XSD

    这篇关于什么是C ++最好的开放XML解析器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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