tinyxml2安装
下载地址 https://github.com/leethomason/tinyxml2
使用 git 下载
(1)下载 tinyxml2
git clone https://github.com/leethomason/tinyxml2.git
(2)进入相应目录并编译
cd tinyxml2/ cmake . make
(3)测试该版本的准确性
./xmltest
(4)安装
sudo make install
5、写xmltest.cpp 遍历节点
void traversingXML(XMLNode* node) {
//查看 node 节点
printf(node->Value());
if(node->NoChildren())
return;
XMLNode* child = node->FirstChild();
while(child != nullptr) {
traversingXML(child);
child = child->NextSibling();
}
}