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


C++ CXmlNode类代码示例

本文整理汇总了C++中CXmlNode的典型用法代码示例。如果您正苦于以下问题:C++ CXmlNode类的具体用法?C++ CXmlNode怎么用?C++ CXmlNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: ReadValueString

	std::wstring CXmlNode::ReadValueString(const std::wstring& sName, const std::wstring& nDef)
	{
		CXmlNode oTemp;
		if (GetNode(sName, oTemp))
			return oTemp.GetText();
		return L"";
	}
开发者ID:ONLYOFFICE,项目名称:core,代码行数:7,代码来源:xmldom.cpp

示例2: xpath

HRESULT CXmlDocument::SetXmlDocument(VARIANT* pXmlDocument, bool& bLoginPage,bool bCheckLogin, bool& bErrXml)
{
	bCheckLogin;
	bErrXml = false;
	bLoginPage = false;

	CString xpath(_T("//AwsTimeout/Url"));
	CString errpath(_T("//Error"));
	CXmlNode node;

	if (SetXmlDocument(pXmlDocument)==S_OK)
	{
		
		if (m_pNode!=NULL)
		{
			node = Find(xpath);
			if (!node.IsNull())
				bLoginPage = true;

			node = Find(errpath);
			if(!node.IsNull()) 
				bErrXml = true;
		}
	}
	return S_OK;
}
开发者ID:firememory,项目名称:BuddyDesk,代码行数:26,代码来源:Util_XMLDOM.cpp

示例3: CDefaultRecord

//----------------------------------------
CDefaultRecord* CAliasesDictionary::CreateDefaultRecord(CXmlNode* defaultRecordNode)
{
  if (defaultRecordNode == NULL)
  {
    return NULL;
  }

  CDefaultRecord* defaultRecord = new CDefaultRecord();

  std::string value;

  bool bOk = defaultRecordNode->GetPropVal(CAliasesDictionary::m_NAME_ATTR, &value);
  if (!bOk)
  {
    std::string msg = CTools::Format("Unable to create default record - Default record name is empty - "
      "Please check all '%s' attributes of the '%s' elements in the aliases dictionary '%s'.",
      CAliasesDictionary::m_NAME_ATTR.c_str(),
      CAliasesDictionary::m_DEFAULT_RECORD_ELT.c_str(),
      m_fullFileName.c_str());

    delete defaultRecord;
    defaultRecord = NULL;

    throw CXMLException(msg, BRATHL_ERROR);
  }

  defaultRecord->SetName(value);

  CObArray arrayNodes(false);
  
  FindAllNodesByName(CAliasesDictionary::m_PRODUCT_TYPE_ELT, defaultRecordNode, arrayNodes, false);

  CObArray::const_iterator it;

  for(it = arrayNodes.begin() ; it != arrayNodes.end() ; it++)
  {
    CXmlNode* node = dynamic_cast<CXmlNode*>(*it);

    if (node == NULL)
    {
      continue;
    }

    CXmlNode* textNode = node->GetChildren();

    if (textNode == NULL)
    {
      continue;
    }

    std::string productType = textNode->GetContent().c_str();
    if (productType.empty())
    {
      continue;
    }
    defaultRecord->AddProductType(productType);
  }

  return defaultRecord;
}
开发者ID:BRAT-DEV,项目名称:main,代码行数:61,代码来源:AliasesDictionary.cpp

示例4: SetNodeAttribute

bool CXmlDocument::SetNodeAttribute(const CXmlNode& node, const CString& attributeName, const CString& value)
{
	if(node.GetNode() == NULL)
		return FALSE;

	XmlAttribute pAttr;
	HRESULT hr = m_pDoc->createAttribute((_bstr_t)attributeName, &pAttr);
	if ( FAILED(hr) )
		return FALSE;

	hr = pAttr->put_text((_bstr_t)value);
	if( FAILED(hr) )
		return FALSE;

	XmlMap pNodeMap;
	hr = node.GetNode()->get_attributes(&pNodeMap);
	if ( FAILED(hr) )
		return FALSE;

	XmlNode pNamedItem;
	hr = pNodeMap->setNamedItem(pAttr, &pNamedItem);
	if ( FAILED(hr) )
		return FALSE;

	return TRUE;
}
开发者ID:firememory,项目名称:BuddyDesk,代码行数:26,代码来源:Util_XMLDOM.cpp

示例5: GetFirstChildNode

BOOL CXmlNode::GetFirstChildNode(LPCTSTR pNodeName, CXmlNode& objXmlNode)
{
	IXMLDOMNode * pXMLNode, * pTmpXMLNode;
	BSTR bstrNodeName;
	HRESULT hr;

	if (!pNodeName || !m_pXMLNode)
		return FALSE;

	pXMLNode = NULL;
	hr = m_pXMLNode->get_firstChild(&pXMLNode);
	while (hr == S_OK)
	{
		bstrNodeName = NULL;
		hr = pXMLNode->get_nodeName(&bstrNodeName);
		if (hr == S_OK)
		{
			int nRet = wcscmp(bstrNodeName, pNodeName);
			::SysFreeString(bstrNodeName);
			if (nRet == 0)
			{
				objXmlNode.Attach(pXMLNode);
				return TRUE;
			}
		}

		pTmpXMLNode = NULL;
		hr = pXMLNode->get_nextSibling(&pTmpXMLNode);
		pXMLNode->Release();
		pXMLNode = pTmpXMLNode;
	}

	objXmlNode.Attach(NULL);
	return FALSE;
}
开发者ID:wyrover,项目名称:IMClient,代码行数:35,代码来源:XmlDocument.cpp

示例6: SelectSingleNode

BOOL CXmlDocument::SelectSingleNode(LPCTSTR pNodeName, CXmlNode& objXmlNode)
{
	IXMLDOMNode * pXMLNode;
	BSTR bstrNodeName;
	HRESULT hr;

	if (NULL == pNodeName || NULL == m_pXMLDoc)
		return FALSE;

	bstrNodeName = ::SysAllocString(pNodeName);

	pXMLNode = NULL;
	hr = m_pXMLDoc->selectSingleNode(bstrNodeName, &pXMLNode);
	::SysFreeString(bstrNodeName);
	if (hr == S_OK)
	{
		objXmlNode.Attach(pXMLNode);
		return TRUE;
	}
	else
	{
		objXmlNode.Attach(NULL);
		return FALSE;
	}
}
开发者ID:wyrover,项目名称:IMClient,代码行数:25,代码来源:XmlDocument.cpp

示例7: LoadNonFillVecElem

BOOL CXMLVecLS::LoadNonFillVecElem(COutlined *pElem,CXmlNode &node)
{
	pElem->SetDasHStyle(node.GetIntAttrib(_T("DashStyle")));
	pElem->SetOutlineWidth(node.GetIntAttrib(_T("OutlineWidth")));
	pElem->SetOutlineColor(node.GetUIntAttrib(_T("OutlineColor")));
	return TRUE;
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例8: GetNameSpaces

CString CXmlDocument::GetNameSpaces()
{
	CString cstr,xpath,name,ns;
	int at;
	long count;
	count = m_pDoc->namespaces->length;
	CXmlNode node;
	for(long i =0;i<count;++i)
	{
		ns = (LPCTSTR)m_pDoc->namespaces->namespaceURI[i];
		xpath.Format(_T("//*[namespace-uri()='%s']"),ns);
		node = this->Find(xpath);
		if(node.IsValid())
		{
			name = node.GetName();
			if((at=name.Find(_T(":"),0))>=0)
			{
				if(!cstr.IsEmpty()) cstr += _T(" ");
				cstr.AppendFormat(_T("xmlns:%s='%s'"),name.Left(at),ns);
			}
		}

	}
	return cstr;
}
开发者ID:firememory,项目名称:BuddyDesk,代码行数:25,代码来源:Util_XMLDOM.cpp

示例9: ReadValueString

	CString CXmlNode::ReadValueString(const CString& sName, const CString& nDef)
	{
		CString sRes;
		CXmlNode oTemp;
		if(GetNode(sName, oTemp))
			sRes = oTemp.GetText();
		return sRes;
	}
开发者ID:alexandervnuchkov,项目名称:core,代码行数:8,代码来源:libxml2.cpp

示例10: SetNodeValue

void CXmlNode::SetNodeValue(const CString& xpath, const CString& value)
{
	CXmlNode node = this->Find(xpath);
	if(node.IsNull())
		return;
	else
		node.SetValue(value);
}
开发者ID:firememory,项目名称:BuddyDesk,代码行数:8,代码来源:Util_XMLDOM.cpp

示例11: SaveFilledVecElem

void  CXMLVecLS::SaveFilledVecElem(const CFilled *pElem,CXmlNode &node)
{
	node.SetAttrib(_T("Outline"),pElem->IsOutline());
	node.SetAttrib(_T("DashStyle"),pElem->GetDashStyle());
	node.SetAttrib(_T("OutlineWidth"),pElem->GetOutlineWidth());
	node.SetAttrib(_T("OutlineColor"),pElem->GetOutlineColor());

	node.SetAttrib(_T("Fill"),pElem->IsFill());
	node.SetAttrib(_T("FillColor"),pElem->GetFillColor());
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例12: LoadMiscConfig

// 加载杂项配置
BOOL LoadMiscConfig(LPCTSTR lpszFileName)
{
	CXmlDocument xmlDoc;
	CXmlNode xmlNode;

	BOOL bRet = xmlDoc.Load(lpszFileName);
	if (!bRet)
		return FALSE;

	bRet = xmlDoc.SelectSingleNode(_T("/Misc/FontInfo"), xmlNode);
	if (bRet)
	{
		g_fontInfo.m_strName = xmlNode.GetAttribute(_T("Name"));
		g_fontInfo.m_nSize = xmlNode.GetAttributeInt(_T("Size"));
		tstring strColor = xmlNode.GetAttribute(_T("Color"));
		g_fontInfo.m_clrText = HexStrToRGB(strColor.c_str());
		g_fontInfo.m_bBold = xmlNode.GetAttributeInt(_T("Bold"));
		g_fontInfo.m_bItalic = xmlNode.GetAttributeInt(_T("Italic"));
		g_fontInfo.m_bUnderLine = xmlNode.GetAttributeInt(_T("UnderLine"));
	}

	bRet = xmlDoc.SelectSingleNode(_T("/Misc/HotKey"), xmlNode);
	if (bRet)
	{
		tstring strHotKey = xmlNode.GetText();
		g_cHotKey = toupper(strHotKey.at(0));
	}

	xmlNode.Release();
	xmlDoc.Release();

	return TRUE;
}
开发者ID:03050903,项目名称:MingQQ,代码行数:34,代码来源:FontSelDlg.cpp

示例13: Do

void CComplexTest::Do(const _tstring & sFileName)
{
	CXmlNode xmlData;
	boost::property_tree::xml_parser::read_xml(sFileName, xmlData);

	const CXmlNode& xmlCase = xmlData.get_child(_T("complex_test.cases.case"));

	CTestCase Case;
	Case.Execute(xmlCase);

}
开发者ID:Bia10,项目名称:clrn,代码行数:11,代码来源:ComplexTest.cpp

示例14:

_variant_t CXmlNode::GetNodeAttributeData(LPCTSTR xpath,LPCTSTR attrname,const _variant_t defVar)
{
	CXmlNode node = this->Find(xpath);
	if(node.IsNull())
	{
		return defVar;
	}
	else
	{
		return node.GetAttributeData(attrname, defVar); //Using the default value specified by a client
	}
}
开发者ID:firememory,项目名称:BuddyDesk,代码行数:12,代码来源:Util_XMLDOM.cpp

示例15: GetNodeAttribute

CString CXmlNode::GetNodeAttribute(LPCTSTR xpath,LPCTSTR attrname)
{
	CXmlNode node = this->Find(xpath);
	if(node.IsNull())
	{
		return _T("");
	}
	else
	{
		return node.GetAttribute(attrname);
	}
}
开发者ID:firememory,项目名称:BuddyDesk,代码行数:12,代码来源:Util_XMLDOM.cpp


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