JustMeAlone
New Member
I'm use g++ and libxml2 static void print_element_names(xmlNode * a_node,xmlDoc * doc){ \[code\] xmlNode *cur_node = NULL; const char *c= "city"; xmlChar *name;\[/code\]for (cur_node = a_node; cur_node; cur_node = cur_node->next) {\[code\] if (cur_node->type == XML_ELEMENT_NODE) { std::cout<<convert(cur_node)<<std::endl; } if (convert(cur_node)==c){std::cout<<"Found node"<<std::endl;}//work but not equal with city print_element_names(cur_node->children,doc);}\[/code\]}char * convert(xmlNode * a_node){char* a = (char *)a_node->name; return a;}result isaddress_bookpersonnameaddressstreetcitystatezipphoneIt not equl with "city" maybe becuase xmlChar and char.How can I compare nodename with char ?