What is the best open XML parser for C++? [duplicate]
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 treebuilding) approaching speed ofstrlen function executed on thesame data.
- On a modern CPU (as of 2008) theparser throughput is about 1 billioncharacters per second. SeePerformance section in the OnlineManual.
- Small memory footprint of the codeand created DOM trees.
- A headers-only implementation,simplifying the integration process.
- Simple license that allows use foralmost any purpose, both commercialand non-commercial, without anyobligations.
- Supports UTF-8 and partially UTF-16,UTF-32 encodings.
- Portable source code with nodependencies other than a very smallsubset of C++ Standard Library.
- This subset is so small that it canbe easily emulated manually if useof standard library is undesired.
Limitations
- The parser ignores DOCTYPEdeclarations.
- There is no support for XML namespaces.
- The parser does not check forcharacter validity.
- The interface of the parser does notconform to DOM specification.
- The parser does not check forattribute 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.
pugixml - Light-weight, simple and fast XML parser for C++Very small (comparable to RapidXML), very fast (comparable to RapidXML), very easy to use (better than RapidXML).