I have this snippet of code inside my project that has to search for an exact match inside an XML tree parsed with RapidXML. It does find the match but at the end it's always a null pointer match. I can't figure out the order in which I should code the function can somebody help me out?
xml_node<>* processNode(xml_node<>* node, char* lookout)
{
for (xml_node<>* child = node->first_node(); child; child = child->next_sibling())
{
cout << "processNode: child name is " << child->name() << " comparing it with " << lookout << endl;
if (strcmp(child->name(), lookout) == 0) {
return child;
}
processNode(child, lookout);
}
return nullptr;
}