本帖最后由 ysh2013 于 2010-06-12 22:11:44 编辑

解决方案 »

  1.   

    xml.ResetMainPos();
    xml.FindElem();
    xml.IntoElem();
    xml.FindElem();
    AfxMessageBox(xml.GetData());
      

  2.   

    http://www.cnblogs.com/bingxuefly/archive/2007/04/23/724318.html
      

  3.   

    这个格式不符合XML规范,不是所有XML解析器都能解析隐含的文本标签,最好改成
    <a>
      <b>
      <d>tttt</d>
      <c>1234</c>
      <d>ssss</d>
      </b>
    </a>
      

  4.   

    LOAD的时候最好检查一下XML的合法性
      

  5.   

    研究下CMarkUp的代码吧,看Load时可以将你所给格式的XML加载成功不。调试跟踪下
      

  6.   

    研究下CMarkUp的代码吧,看Load时可以将你所给格式的XML加载成功不。调试跟踪下
      

  7.   

    个人总结的VC使用Cup生成、解析xml资料   
    http://download.csdn.net/source/992877 
    CMarkup官网地址   
    http://www.firstobject.com/判断xml是否结构正确用 .IsWellFormed();
      

  8.   

    xml.ResetMainPos();
    xml.FindElem();
    xml.IntoElem();
    xml.FindElem();
    AfxMessageBox(xml.GetData());
      

  9.   

    你可以用其他方法搞出c来,但是为什么一定要用CMarkup。
    下面的显然不是XML结构的东西了,去解析字符串吧。tttt
      <c>1234</c>
    ssss
      

  10.   

    提供几个函数:
    //----查看所有UserID----       
    CMarkup xml;       
    xml.Load("UserInfo.xml");       
    BOOL bFind = true;       
    xml.ResetMainPos();       
    while (xml.FindChildElem("UserID");)       
    {       
          //此时接点还是父接点       
            CString strTagName = _T("");       
            CString strData = _T("");       
            strTagName = xml.GetChildTagName();       
            strData = xml.GetChildData();       
            TRACE("\n---tagName:%s,Data:%s--\n",strTagName,strData);       
    }       
    本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/kenkao/archive/2009/03/27/4030158.aspx
    此外,需要了解关于FindChildElem的用法:
    If there is a main position and no current child position, FindChildElem() locates the first child element under the main position and makes it the child position. If there is a child element, it moves to the next child element. If there is no child element or no next child element, it returns false and leaves the child position where it was.详细的信息还要到网站看:http://www.firstobject.com/dn_FindChildElem.htm;
    不是什么难问题,建议先google一下
      

  11.   

    你有tttt和ssss两个标签,GetData()蒙了,不知道Get哪个?