读取和使用xml文件的一般步骤

来源:互联网 发布:商品推荐算法 聚类 编辑:程序博客网 时间:2024/06/13 21:50

使用到了tinyxml这个开源的类

CString strConfigFile = _T("XXX.xml");TiXmlDocument doc(strConfigFile);if (doc.LoadFile()){TiXmlElement* pRootNode = doc.RootElement();TiXmlElement* pBlkNode = NULL;if(pRootNode)pBlkNode = pRootNode->FirstChildElement();// add itemswhile (pBlkNode){//Do sth with this nodepBlkNode = pBlkNode->NextSiblingElement();} }


0 0
原创粉丝点击