// make sure the full path is created already
XMLNode node = NULL;
if (treePath != _T("")){
CComBSTR str = treePath;
node = m_DomDoc->selectSingleNode(str.m_str);
if (node == NULL){
CreateNode(treePath);
node = m_DomDoc->selectSingleNode(str.m_str);
}
str.Empty();
}
// Get Attributes
vector<CString> attrName, attrValue;
if (elementName.ReverseFind(_T('[')) != -1){
CString strAttrs = elementName.Right(elementName.GetLength()-elementName.Find(_T('['))-1);
elementName = elementName.Left(elementName.Find(_T('[')));
strAttrs.Delete(strAttrs.ReverseFind(_T(']')), 1);
int iStrAttrStart = strAttrs.Find(_T('@'));
if (iStrAttrStart == -1)
return ERROR_INVALID_ARG;
while (TRUE){
int iNextAttrStart = strAttrs.Find(_T('@'), iStrAttrStart+2);
bool bFinish = (iNextAttrStart == -1);