我正在寻找一个简单,干净,正确的XML解析器在我的c++项目中使用。我应该自己写吗?
当前回答
TinyXML最适合简单的XML工作,但是如果你需要更多的特性,那么试试apache项目中的Xerces。转到下一页阅读更多关于它的功能。
http://xerces.apache.org/xerces-c/
其他回答
如果你关心效率/内存管理,不要使用TinyXML(它倾向于分配大量的小块)。我个人最喜欢的是RapidXML。
TinyXML最适合简单的XML工作,但是如果你需要更多的特性,那么试试apache项目中的Xerces。转到下一页阅读更多关于它的功能。
http://xerces.apache.org/xerces-c/
TiCPP是TinyXML的“更c++”版本。
'TiCPP' is short for the official name TinyXML++. It is a completely new interface to TinyXML (http://www.grinninglizard.com/tinyxml/) that uses MANY of the C++ strengths. Templates, exceptions, and much better error handling. It is also fully documented in doxygen. It is really cool because this version let's you interface tiny the exact same way as before or you can choose to use the new 'ticpp' classes. All you need to do is define TIXML_USE_TICPP. It has been tested in VC 6.0, VC 7.0, VC 7.1, VC 8.0, MinGW gcc 3.4.5, and in Linux GNU gcc 3+
pugixml——轻量级、简单、快速的c++ XML解析器 非常小(可与RapidXML媲美),非常快(可与RapidXML媲美),非常容易使用(优于RapidXML)。
TinyXML,还有boost。propertytree。后者并不满足所有的官方要求,但非常简单。