BOOL XMLDomParser::OnStartElement(const XML_Char *name, const XML_Char **atts) { XMLElementNode* pParent = m_stack.top(); XMLElementNode* pElemNode = new XMLElementNode(); pElemNode->SetTagName(name); int i = 0; while(atts[i]) { const char* n = atts[i]; const char* val = atts[i+1]; pElemNode->AddAttribute(n, val); i += 2; } pParent->AddChild(pElemNode); m_stack.push(pElemNode); return TRUE; }