请教Cmarkup 读取XML出错
时间:2011-12-04
来源:互联网
C/C++ code
C/C++ code
Item中得子项可以读出来,但是Item子项中</MedListInfo>它的子项读取不出来。可以查找到MedListInfo,不知道怎么读它的子项,每次读都是空值。
请知道的帮帮忙。
<SetItem> <Item> <RedValue>50</RedValue> <BlueValue>50</BlueValue> <CheckisFull>0</CheckisFull> <MedListInfo> <MedIndex>0</MedIndex> <MedNameList>气血值</MedNameList> <MedTypeList>type</MedTypeList> <MedCondition>气血值低于50</MedCondition> </MedListInfo> </Item> </SetItem>
C/C++ code
CMarkup xml; xml.Load(G_s_protectmsg->SetPath);//加载XML文件 BOOL bFind = true; xml.ResetMainPos(); xml.FindElem(); xml.IntoElem(); while (xml.FindElem(_T("Item"))) { CString strTagName = _T(""); CString strData = _T(""); strTagName = xml.GetTagName(); //逐次查找子项 xml.FindChildElem(_T("RedValue"));//补充值范围 CString redvalue = xml.GetChildData(); int RedValue = _wtoi(redvalue); G_s_protectmsg->RedValue = RedValue; while(xml.FindChildElem(_T("MedListInfo"))) { xml.FindChildElem(_T("MedIndex")); CString csMedindex = xml.GetChildData(); int LMedindex = _wtoi(csMedindex); G_s_protectmsg->indexlist = LMedindex; xml.FindChildElem(_T("MedNameList")); CString csMedNameList = xml.GetChildData(); wcscpy_s(G_s_protectmsg->MedNameList,csMedNameList.GetBuffer()); csMedNameList.ReleaseBuffer(); }
Item中得子项可以读出来,但是Item子项中</MedListInfo>它的子项读取不出来。可以查找到MedListInfo,不知道怎么读它的子项,每次读都是空值。
请知道的帮帮忙。
作者: cityboyloving 发布时间: 2011-12-04
取它的子项之前,是不是要进入该结点呀?
作者: JoeBlackzqq 发布时间: 2011-12-04
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28