本文整理汇总了C++中msxml2::IXMLDOMNamedNodeMapPtr::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ IXMLDOMNamedNodeMapPtr::Release方法的具体用法?C++ IXMLDOMNamedNodeMapPtr::Release怎么用?C++ IXMLDOMNamedNodeMapPtr::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类msxml2::IXMLDOMNamedNodeMapPtr
的用法示例。
在下文中一共展示了IXMLDOMNamedNodeMapPtr::Release方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetNamespacePrefix
CStdString SmartTagParser::GetNamespacePrefix()
{
if (m_spXMLDom == NULL)
{
CStdString msg;
msg.Format(_T("SmartTagParser::GetNamespacePrefix - The XML document pointer is null."));
throw Workshare::NullReferenceException(msg);
}
MSXML2::IXMLDOMElementPtr spElement = m_spXMLDom->firstChild;
if (spElement == NULL)
{
CStdString msg;
msg.Format(_T("SmartTagParser::GetNamespacePrefix - Failed to get the first node of the document."));
throw Workshare::Exception(msg);
}
MSXML2::IXMLDOMNamedNodeMapPtr spAttributes = spElement->attributes;
if (spAttributes == NULL)
{
spElement.Release();
CStdString msg;
msg.Format(_T("SmartTagParser::GetNamespacePrefix - Failed to get attributes of the first child of the document."));
throw Workshare::Exception(msg);
}
MSXML2::IXMLDOMAttributePtr spAttribute = spAttributes->item[0];
if (spAttribute == NULL)
{
spElement.Release();
spAttributes.Release();
CStdString msg;
msg.Format(_T("SmartTagParser::GetNamespacePrefix - Failed to get attributes of the first child of the document."));
throw Workshare::Exception(msg);
}
CStdString sFullNamespace = spAttribute->xml;
HRESULT hr = m_spXMLDom->raw_setProperty(_T("SelectionNamespaces"), _variant_t(sFullNamespace.c_str()));
if (FAILED(hr))
{
CStdString message;
message.Format(_T("SmartTagParser::SmartTagParser - Failed to set namespace : %s."), sFullNamespace.c_str());
throw Workshare::Com::ComException(message.c_str(), hr, m_spXMLDom);
}
int iPosStart = sFullNamespace.Find(_T(":"));
int iPosEnd = sFullNamespace.Find(_T("="));
CStdString sPrefix = sFullNamespace.Mid(iPosStart+1, iPosEnd - (iPosStart+1));
spElement.Release();
spAttributes.Release();
spAttribute.Release();
return sPrefix;
}
示例2: GetData
/******************************************************************************
Function Name : GetData
Input(s) : MSXML2::IXMLDOMNodePtr& pIDomNode
Output : HRESULT
Functionality :
Member of : CWaitEntity
Friend of : -
Author(s) : Venkatanarayana Makam
Date Created : 06/04/2011
Modifications :
******************************************************************************/
HRESULT CWaitEntity::GetData(MSXML2::IXMLDOMNodePtr& pIDomNode)
{
_bstr_t bstrNodeName;
CComVariant NodeValue;
MSXML2::IXMLDOMNamedNodeMapPtr pDOMWaitAtrributes;
pDOMWaitAtrributes = pIDomNode->Getattributes();
MSXML2::IXMLDOMNodePtr pIDOMChildNode;
//bstrNodeName = L"purpose";
bstrNodeName.Assign(SysAllocString(CT2W("purpose")));
pIDOMChildNode = pDOMWaitAtrributes->getNamedItem(bstrNodeName);
pIDOMChildNode->get_nodeTypedValue(&NodeValue);
m_ouData.m_omPurpose = strCopyBSTRToCString(NodeValue);
pIDomNode->get_nodeTypedValue(&NodeValue);
CString strTemp;
strTemp = strCopyBSTRToCString(NodeValue);
//W4 Removal - Type Conversion No problem.
m_ouData.m_ushDuration = (USHORT)atoi((LPCSTR)strTemp);
pIDOMChildNode.Release();
pDOMWaitAtrributes.Release();
return S_OK;
}