
于 2013年06月27日 14:55, Xu Wang 写道:
+static xmlNodePtr seek_subNode(xmlNodePtr node, char *tag) +{ + xmlNodePtr child = node->children; + xmlNodePtr ret = NULL; + + if (child == NULL) { + return NULL; + } + + while (child) { + if (XSTREQ(child->name, tag)) { + return child; + } + + ret = seek_subNode(child, tag); + if (ret) { + return ret; + } + + child = child->next; if (ret == NULL) and (child = (child->next ) ==NULL)
what would seek_subNode return ? should return a NULL when quit from while loop.
+ } +}
-- Thanks Eli.(Li Yong Qiao/qiaoly@cn.ibm.com Chinese Name:乔立勇) LTC, Chian CSTL