Hi guys,
Looking for opinions on what would be the best/easiest xml parser to use.
Size and speed aren't really an issue here, just ease of use. Using std::strings as well would be beneficial.
Please reply only if you've had experience using one.
Hi guys,
Looking for opinions on what would be the best/easiest xml parser to use.
Size and speed aren't really an issue here, just ease of use. Using std::strings as well would be beneficial.
Please reply only if you've had experience using one.
Look in the boost libraries, I think it has an xml parser.
I like xerces (http://xerces.apache.org/xerces-c), but you need to write many lines of code or write own wrapper. More convenient way is using XML Data Binding, see libraries:
- http://www.codesynthesis.com/products/xsd/ (OpenSource, GPL)
- http://www.codalogic.com/lmx/ (Commercial)
Xerces is robust and comprehensive XML parser, with a lot of functionality such as DTD verification and character set detection and conversion (in conjuction with ICU lib). That said, ease of use is NOT it's strong point. The API is huge and it does not use std::string (uses it's own internally defined wide character type), it's default character set is UTF-16 and conversion requires familiarity with the ICU library, which is another monster.
Something that may be more suited to your needs (i.e. lightweight and flexible) would probably be 'expat', though I have only briefly looked at it. Check out http://expat.sourceforge.net/.
Thanks for the opinions guys.
> Size and speed aren't really an issue here, just ease of use.
> Using std::strings as well would be beneficial.
You might want to have a look at TinyXML.
http://www.grinninglizard.com/tinyxml/
And perhaps TinyXML++, which leverages more C++ strengths.
http://code.google.com/p/ticpp/
Hi,
have a look at my comparison site:
http://lars.ruoff.free.fr/xmlcpp/
and send me a comment once you have made your choice!
regards,
Lars
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.