我刚开始使用rapidXML,因为它被推荐给我.现在迭代多个兄弟姐妹我这样做:
//get the first texture node
xml_node<>* texNode = rootNode->first_node("Texture");
if(texNode != 0){
string test = texNode->first_attribute("path")->value();
cout << test << endl;
}
//get all its siblings
while(texNode->next_sibling() != 0){
string test = texNode->first_attribute("path")->value();
cout << test << endl;
texNode = texNode->next_sibling();
}
Run Code Online (Sandbox Code Playgroud)
作为基本测试,它工作正常.无论如何,我遇到了node_iterator,这对我来说似乎是一个额外的迭代器类.无论如何,我找不到任何关于如何使用它的例子,所以我想知道是否有人可以告诉我:)
谢谢!