When comparing RapidXML vs Xerces-C++, the Slant community recommends Xerces-C++ for most people. In the question“What are the best XML parser/generator libraries for C++?” Xerces-C++ is ranked 1st while RapidXML is ranked 3rd. The most important reason people chose Xerces-C++ is:
Xerces has many applications and libraries that give additional functionality to the parser. XQilla, for example, allows for XQuery and XPath implementation.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Header-only implementation
This allows for a very simple integration process of the parser into your code. Only the .hpp file would need to be included into the library.
Pro Very fast parsing speed
"... parsing speed is about 50-100x faster than Xerces DOM, 30-60x faster than TinyXml, 3-12x faster than pugxml, and about 5% - 30% faster than pugixml"
Pro Allows modification of the DOM tree
The DOM tree that is created from the parser is fully modifiable. Nodes and attributes can be added/removed, and their contents changed.
Pro Additional libraries and applications
Xerces has many applications and libraries that give additional functionality to the parser. XQilla, for example, allows for XQuery and XPath implementation.
Pro Validation support
Allows the validation of XML corresponding to the DTD or schema rules linked.
Pro Full Unicode support
This allows all characters to be used and read/written in the DOM tree.
Pro DOM/SAX compliant
Xerces-C++ comes packaged with the API documentation for SAX and DOM. These are two of the most highly used programming interfaces with XML.
Implementation of SAX 1.0/2.0 specification.
Implementation of DOM 1.0, 2.0 (Core, Traversal and Range), and 3.0 (Core, Load and Save) specification.
Cons
Con Not W3C compliant
Ignoring DOCTYPE declarations causes RapidXML to not be a W3C compliant parser. Though it can still successfully parse and produce complete trees of all valid XML files.
Con Overkill for simple needs
If a website only uses a small number of XML, that can easily be handled manually, Xerces-C++ may be considered overkill. All the validation and compliance may not be necessary.