当前位置: 首页>>代码示例>>C++>>正文


C++ XMLNode::GetElementValue方法代码示例

本文整理汇总了C++中XMLNode::GetElementValue方法的典型用法代码示例。如果您正苦于以下问题:C++ XMLNode::GetElementValue方法的具体用法?C++ XMLNode::GetElementValue怎么用?C++ XMLNode::GetElementValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XMLNode的用法示例。


在下文中一共展示了XMLNode::GetElementValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ReadXmlFile

bool CDocMgr::ReadXmlFile(string& szFileName)
{
    //读取Xml文件,并遍历
    XMLRdr xml(szFileName);
    //string str(m_DocLst.GetBuffer(1)); 
    //m_DocLst.ReleaseBuffer();
    //xml.ProcessString(str);
    XMLNode *root = xml.GetRootNode();
    if(root == NULL) return false;
    long cnt = root->GetChildNodeCnt();
    
    for(int i=0;i<cnt;i++)
    {
        XMLNode *chdNode = root->GetNextChild();
        if(chdNode == NULL) return false;
        string sType = chdNode->GetElementValue("Type");
        string sAlias = chdNode->GetElementValue("Alias");
        string sTitle = chdNode->GetElementValue("Title");
        string sEncode = chdNode->GetElementValue("Encode");
        string sPage = chdNode->GetElementValue("iPage");
        string sSize = chdNode->GetElementValue("Size");
        //string sUpdated = chdNode->GetElementValue("Updated");
        string sEdition = chdNode->GetElementValue("Edition");
        string sURL = chdNode->GetElementValue("URL");
        string sfullURL = chdNode->GetElementValue("fullURL");
        string sProcessType = chdNode->GetElementValue("ProcessType");
        string sIsZhengWen = chdNode->GetElementValue("IsZhengWen");
        //string sMossSiteURL = chdNode->GetElementValue("MossSiteURL");
        string sFolderName = chdNode->GetElementValue("FolderName");
        string sFileName = chdNode->GetElementValue("FileName");

        string sIsCopy = chdNode->GetElementValue("IsCopy");
        string sWorkItemID = chdNode->GetElementValue("WorkItemID");

        CString csType(sType.c_str());
        CString csAlias(sAlias.c_str());
        CString csTitle(sTitle.c_str());
        CString csEncode(sEncode.c_str());
        CString csPage(sPage.c_str());
        CString csSize(sSize.c_str());
        //CString csUpdated(sUpdated.c_str());
        CString csEdition(sEdition.c_str());
        CString csURL(sURL.c_str());
        CString csfullURL(sfullURL.c_str());
        CString csProcessType(sProcessType.c_str());
        CString csIsZhengWen(sIsZhengWen.c_str());
        //CString csMossSiteURL(sMossSiteURL.c_str());
        CString csFolderName(sFolderName.c_str());
        CString csFileName(sFileName.c_str());

        CString csIsCopy(sIsCopy.c_str());
        CString csWorkItemID(sWorkItemID.c_str());

        InsertDocItem(csAlias, csEncode, csPage, csSize, csType, csTitle, 
                csEdition, csURL, csfullURL,csProcessType, 
                csIsZhengWen, csFolderName, csFileName, csIsCopy, csWorkItemID);
    }
	return true;
}
开发者ID:BGCX261,项目名称:zhoulijinrong-svn-to-git,代码行数:59,代码来源:DocMgr.cpp


注:本文中的XMLNode::GetElementValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。