There are plenty of Libraries to parse XML, but it seems there aren’t many good (?) ways to write XML in C++.
Libraries I’ve been using so far:
- PugiXML: really lightweight, very straightforwarded API, but it seems to lack a way to write XML (Or I haven’t found it yet)
- RapidXML: I don’t have much experience with RapidXML; But it does look nice.
- TinyXML: I find it odd that the STL TinyXML needs to be explicitly “enabled” in TinyXML – I mean, if your compiler doesn’t support the STL, get a better one!
Anyway, to make my point clear, I have written a PHP Script that does what I plan to do in C++: http://codepad.org/RyhQSgcm
I really appreciate any help!
Xerces DOM Parser
Xerces-C++ is a validating XML parser written in a portable subset of C++. Xerces-C++ makes it easy to give your application the ability to read and write XML data. A shared library is provided for parsing, generating, manipulating, and validating XML documents using the DOM, SAX, and SAX2 APIs. For an introduction to programming with Xerces-C++ refer to the Programming Guide.
The POCO project also has an XMLWriter that will allow you to generate XML.
Of course there is always this existing StackOverflow post.