XmlNode* XmlNode::FindChild(const char* path) { XmlNode* result = this; if ((path != NULL) && (path[0] != '\0')) { MultiString names(path, "/", NULL); if (names.word_count() > 0) { int k = 0; int m = names.word_count() - 1; while ((k < m) && (result != NULL)) { const char* name = names.word(k); int i = 0; int n = result->ChildCount(); while ((i < n) && (strcmp(result->Child(i)->Name(), name) != 0)) ++i; // next child if (i < n) result = result->Child(i); else result = NULL; //not found ++k; // next level } } } return result; }
inline XmlNode* NonRecursiveXmlNodeEnumerator::Current() { return m_Parent->Child(m_CurrentChild); }