Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c++ rapidxml node_iterator example?

Tags:

c++

xml

rapidxml

I just started using rapidXML since it was recommended to me. Right now to iterate over multiple siblings i do this:

//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();
}

as a basic test and it works fine. Anyways, I came across node_iterator which seems to be an extra iterator class to do this for me. anyways, I could not find any example on how to use it, so I was wondering if some one could show me :)

thanks!

like image 882
user240137 Avatar asked Jan 20 '10 20:01

user240137


1 Answers

The documentation that I could find documents no node_iterator type. I can't even find the word iterator on that page except in reference to output iterators, which you clearly don't want.

It could be that it's an internal API, or one under development, so you're probably best not to use it right now.

like image 69
coppro Avatar answered Oct 21 '22 02:10

coppro