73. Serializing and deserializing data to/from XML

The C++ standard library does not have any support for XML, but there are multiple open source, cross-platform libraries that you can use. Some libraries are lightweight, supporting a set of basic XML features, while others are more complex and rich in functionality. It is up to you to decide which is most suitable for a particular project.

The list of libraries you may want to consider should include Xerces-C++, libxml++, tinyxml or tinyxml2, pugixml, gSOAP, and RapidXml. For solving this particular task I will choose pugixml. This is a cross-platform, lightweight library, with a fast, although non-validating, XML parser. It has a DOM-like interface with rich traversal/modification capabilities, ...

Get The Modern C++ Challenge now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.