What library to use to *write* XML file in a C++ program? What library to use to *write* XML file in a C++ program? xml xml

What library to use to *write* XML file in a C++ program?


I tried different libraries and finally decided for TinyXml. It's compact, fast, free (zlib license) and very easy to use.


Question: Are you ever going to update an XML file? Because while that sounds like it's just more writing, with XML it still requires a parser.

While xerces is large and bloated, it is fully standards compliant and it is DOM based. Should you ever have to cross platform or change language, there will always be a DOM based library for whatever language/platform you might move to so knowing how DOM based parsing/writing works is a benefit. If you are going to use XML, you may as well use it correctly.

Avoiding XML altogether is of course the best option. But short of that, I'd go with xerces.


You can use Xerces-C++, a library written by Apache foundation. This library permits read, write and manipulate XML files.

Link: http://xerces.apache.org/xerces-c/