本文整理汇总了C++中msxml2::IXMLDOMElementPtr类的典型用法代码示例。如果您正苦于以下问题:C++ IXMLDOMElementPtr类的具体用法?C++ IXMLDOMElementPtr怎么用?C++ IXMLDOMElementPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IXMLDOMElementPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readObject
BOOL WXmlParse::readObject(std::vector<ExternalObject *> &objTree)
{
MSXML2::IXMLDOMDocumentPtr doc;
MSXML2::IXMLDOMElementPtr docRoot;
MSXML2::IXMLDOMElementPtr docElement;
MSXML2::IXMLDOMNodeListPtr elementNodes;
MSXML2::IXMLDOMNamedNodeMapPtr elementAttributes;
MSXML2::IXMLDOMNodePtr xmlNode;
MSXML2::IXMLDOMNodePtr xmlSubNode;
MSXML2::IXMLDOMNodePtr xmlAttrNode;
doc.CreateInstance(__uuidof(DOMDocument30));
doc->load((_variant_t)m_strFileName);
docRoot = doc->GetdocumentElement();//获得根节点;
docRoot->get_childNodes(&elementNodes);
LONG length, subLength, attrLength;
elementNodes->get_length(&length);
MSXML2::IXMLDOMNodeListPtr subElementNodes;
// 3 : 递归获取对象树
elementNodes->get_item(3, &xmlNode);
xmlNode->get_childNodes(&subElementNodes);
subElementNodes->get_length(&subLength);
for (int j = 0; j < subLength;j++)
{
ExternalObject *objTmp = new ExternalObject();
subElementNodes->get_item(j, &xmlSubNode);//获得某个属性
xmlSubNode->get_attributes(&elementAttributes);
readObject(objTmp, xmlSubNode);
objTree.push_back(objTmp);
}
return TRUE;
}
示例2: readExtendModName
BOOL WXmlParse::readExtendModName(std::vector<std::pair<string, string> > &modNames)
{
MSXML2::IXMLDOMDocumentPtr doc;
MSXML2::IXMLDOMElementPtr docRoot;
MSXML2::IXMLDOMElementPtr docElement;
MSXML2::IXMLDOMNodeListPtr elementNodes;
MSXML2::IXMLDOMNamedNodeMapPtr elementAttributes;
MSXML2::IXMLDOMNodePtr xmlNode;
MSXML2::IXMLDOMNodePtr xmlSubNode;
MSXML2::IXMLDOMNodePtr xmlAttrNode;
doc.CreateInstance(__uuidof(DOMDocument30));
doc->load((_variant_t)m_strFileName);
docRoot = doc->GetdocumentElement();//获得根节点;
docRoot->get_childNodes(&elementNodes);
LONG length, subLength, attrLength;
elementNodes->get_length(&length);
MSXML2::IXMLDOMNodeListPtr subElementNodes;
// 3 : 扩展模块列表
elementNodes->get_item(1, &xmlNode);
xmlNode->get_childNodes(&subElementNodes);
subElementNodes->get_length(&subLength);
for (int j = 0; j < subLength;j++)
{
subElementNodes->get_item(j, &xmlSubNode);//获得某个属性
xmlSubNode->get_attributes(&elementAttributes);
MSXML2::IXMLDOMNodePtr nameNode = elementAttributes->getNamedItem("name");
MSXML2::IXMLDOMNodePtr descNode = elementAttributes->getNamedItem("description");
modNames.push_back(std::make_pair(nameNode->text, descNode->text));
}
return TRUE;
}
示例3: SetNodeValue
//设置指定xpath的节点值
BOOL CXmlBase::SetNodeValue(LPCTSTR lpszValue, MSXML2::IXMLDOMNodePtr pNode)
{
if (pNode == NULL) return FALSE;
if (lpszValue == NULL) return FALSE;
MSXML2::IXMLDOMElementPtr pElem = pNode;
pElem->Puttext(lpszValue);
return TRUE;
}
示例4: 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;
}
示例5: CreateStudyNode
static HRESULT CreateStudyNode(DcmDirectoryRecord *studyRec, MSXML2::IXMLDOMElementPtr &patient, MSXML2::IXMLDOMDocumentPtr &pXMLDom)
{
MSXML2::IXMLDOMElementPtr study = pXMLDom->createNode(MSXML2::NODE_ELEMENT, "Study", "http://www.weasis.org/xsd");
if(study == NULL) return CO_E_NOT_SUPPORTED;
const char *buff = NULL, *studyUID = NULL;
if(studyRec->findAndGetString(DCM_StudyInstanceUID, studyUID).bad()) return CO_E_NOT_SUPPORTED;
else study->setAttribute("StudyInstanceUID", studyUID);
if(studyRec->findAndGetString(DCM_StudyDate, buff).bad()) return CO_E_NOT_SUPPORTED;
else study->setAttribute("StudyDate", buff);
if(studyRec->findAndGetString(DCM_StudyTime, buff).good()) study->setAttribute("StudyTime", buff);
if(studyRec->findAndGetString(DCM_StudyID, buff).good()) study->setAttribute("StudyID", buff);
if(studyRec->findAndGetString(DCM_AccessionNumber, buff).good()) study->setAttribute("AccessionNumber", buff);
if(studyRec->findAndGetString(DCM_StudyDescription, buff).good()) study->setAttribute("StudyDescription", buff);
if(studyRec->findAndGetString(DCM_ReferringPhysiciansName, buff).good()) study->setAttribute("ReferringPhysicianName", buff);
patient->appendChild(study);
DcmDirectoryRecord *seriesRec = NULL;
while(seriesRec = studyRec->nextSub(seriesRec))
{
if(seriesRec->getRecordType() != ERT_Series) continue;
CreateSeriesNode(seriesRec, study, pXMLDom, studyUID);
}
return S_OK;
}
示例6: SetData
/******************************************************************************
Function Name : SetData
Input(s) :
Output : HRESULT
Functionality :
Member of : CVerifyResponse
Friend of : -
Author(s) : Venkatanarayana Makam
Date Created : 06/04/2011
Modifications :
******************************************************************************/
HRESULT CVerifyResponse::SetData(MSXML2::IXMLDOMElementPtr& pIDomTestCaseNode)
{
CString omstrTemp;
MSXML2::IXMLDOMDocumentPtr pIDOMDoc;
pIDOMDoc.CreateInstance(L"Msxml2.DOMDocument");
INT lCount = (INT)m_ouData.m_odVerify_MessageEntityList.GetCount();
MSXML2::IXMLDOMElementPtr pIDomSendNode = pIDOMDoc->createElement(_bstr_t(def_STR_VERIFYRES_NODE));
MSXML2::IXMLDOMAttributePtr pIDomTSAtrrib = pIDOMDoc->createAttribute(def_STR_ATTRIB_FAIL);
if(pIDomTSAtrrib!= NULL)
{
switch(m_ouData.m_eAttributeError)
{
case SUCCESS:
omstrTemp = "SUCCESS";
break;
case WARNING:
omstrTemp = "WARNING";
break;
case FATAL:
omstrTemp = "FATAL";
break;
case ERRORS:
default:
omstrTemp = "ERRORS";
break;
}
pIDomTSAtrrib->value = _bstr_t(omstrTemp);
pIDomSendNode->setAttributeNode(pIDomTSAtrrib);
}
MSXML2::IXMLDOMAttributePtr pIDomTSAtrribWait = pIDOMDoc->createAttribute(def_STR_ATTRIB_WAITFOR);
if(pIDomTSAtrribWait!= NULL)
{
CString omstrWaitFor;
omstrWaitFor.Format("%d", m_ushDuration);
pIDomTSAtrribWait->value = _bstr_t(omstrWaitFor);
pIDomSendNode->setAttributeNode(pIDomTSAtrribWait);
}
for(INT i=0; i<lCount; i++)
{
POSITION pos = m_ouData.m_odVerify_MessageEntityList.FindIndex(i);
CVerify_MessageEntity& ouVerifyMsgEntity = m_ouData.m_odVerify_MessageEntityList.GetAt(pos);
ouVerifyMsgEntity.SetData(pIDomSendNode);
}
pIDomTestCaseNode->appendChild(pIDomSendNode);
return S_OK;
}
示例7: readCalculateParams
BOOL WXmlParse::readCalculateParams(WCalcaulateParam &calParam)
{
MSXML2::IXMLDOMDocumentPtr doc;
MSXML2::IXMLDOMElementPtr docRoot;
MSXML2::IXMLDOMElementPtr docElement;
MSXML2::IXMLDOMNodeListPtr elementNodes;
MSXML2::IXMLDOMNamedNodeMapPtr elementAttributes;
MSXML2::IXMLDOMNodePtr xmlNode;
MSXML2::IXMLDOMNodePtr xmlSubNode;
MSXML2::IXMLDOMNodePtr xmlAttrNode;
doc.CreateInstance(__uuidof(DOMDocument30));
if (m_strFileName.IsEmpty())
{
return FALSE;
}
doc->load((_variant_t)m_strFileName);
docRoot = doc->GetdocumentElement();//获得根节点;
docRoot->get_childNodes(&elementNodes);
LONG length, subLength, attrLength;
elementNodes->get_length(&length);
MSXML2::IXMLDOMNodeListPtr subElementNodes;
// 0 :
elementNodes->get_item(2, &xmlNode);
xmlNode->get_childNodes(&subElementNodes);
subElementNodes->get_length(&subLength);
for (int j = 0; j < subLength;j++)
{
subElementNodes->get_item(j, &xmlSubNode);//获得某个属性
xmlSubNode->get_attributes(&elementAttributes);
MSXML2::IXMLDOMNodePtr proNode = elementAttributes->getNamedItem("name");
string proName = proNode->text;
MSXML2::IXMLDOMNodeListPtr subAttrNodes;
xmlSubNode->get_childNodes(&subAttrNodes);
subAttrNodes->get_length(&attrLength);
// ASSERT(attrLength == 2);
MSXML2::IXMLDOMNodePtr descNode;
MSXML2::IXMLDOMNodePtr stateNode;
subAttrNodes->get_item(0, &descNode);
subAttrNodes->get_item(1, &stateNode);
std::vector<string> vecParam;
string descText = descNode->text;
string stateText = stateNode->text;
vecParam.push_back(proName);
vecParam.push_back(descText);
vecParam.push_back(stateText);
calParam.addParam(vecParam);
}
return TRUE;
}
示例8: SetData
/******************************************************************************
Function Name : SetData
Input(s) : MSXML2::IXMLDOMElementPtr& pIDomTestCaseNode
Output : HRESULT
Functionality :
Member of : CReplayEntity
Friend of : -
Author(s) : Venkatanarayana Makam
Date Created : 06/04/2011
Modifications :
******************************************************************************/
HRESULT CReplayEntity::SetData(MSXML2::IXMLDOMElementPtr& pIDomTestCaseNode)
{
CString omstrTemp;
MSXML2::IXMLDOMDocumentPtr pIDOMDoc;
pIDOMDoc.CreateInstance(L"Msxml2.DOMDocument");
if (pIDOMDoc != NULL)
{
MSXML2::IXMLDOMElementPtr pIDomWaitNode = pIDOMDoc->createElement(_bstr_t(def_STR_REPLAY_NODE));
pIDomWaitNode->Puttext(_bstr_t(m_omFilePath));
pIDomTestCaseNode->appendChild(pIDomWaitNode);
}
return S_OK;
}
示例9: readParam
BOOL WXmlParse::readParam(std::vector<WParamDefine *> &outParams)
{
MSXML2::IXMLDOMDocumentPtr doc;
MSXML2::IXMLDOMElementPtr docRoot;
MSXML2::IXMLDOMElementPtr docElement;
MSXML2::IXMLDOMNodeListPtr elementNodes;
MSXML2::IXMLDOMNamedNodeMapPtr elementAttributes;
MSXML2::IXMLDOMNodePtr xmlNode;
MSXML2::IXMLDOMNodePtr xmlSubNode;
MSXML2::IXMLDOMNodePtr xmlAttrNode;
doc.CreateInstance(__uuidof(DOMDocument30));
if (m_strFileName.IsEmpty())
{
return FALSE;
}
doc->load((_variant_t)m_strFileName);
docRoot = doc->GetdocumentElement();//获得根节点;
docRoot->get_childNodes(&elementNodes);
LONG length, subLength, attrLength;
elementNodes->get_length(&length);
MSXML2::IXMLDOMNodeListPtr subElementNodes;
// 0 :
elementNodes->get_item(0, &xmlNode);
xmlNode->get_childNodes(&subElementNodes);
subElementNodes->get_length(&subLength);
for (int j = 0; j < subLength;j++)
{
subElementNodes->get_item(j, &xmlSubNode);//获得某个属性
xmlSubNode->get_attributes(&elementAttributes);
MSXML2::IXMLDOMNodePtr proNode = elementAttributes->getNamedItem("name");
string proName = proNode->text;
WParamDefine *paramTest = new WParamDefine(proName);
MSXML2::IXMLDOMNodeListPtr subAttrNodes;
xmlSubNode->get_childNodes(&subAttrNodes);
subAttrNodes->get_length(&attrLength);
for (int k = 0;k < attrLength;k++)
{
subAttrNodes->get_item(k, &xmlAttrNode);
string attrName = xmlAttrNode->nodeName;
string attrText = xmlAttrNode->text;
paramTest->addValue(attrName, attrText);
}
outParams.push_back(paramTest);
}
return TRUE;
}
示例10: appendTextNode
// 往xml文件里添加换行、制表符
void WXmlParse::appendTextNode(MSXML2::IXMLDOMDocumentPtr &pDoc, MSXML2::IXMLDOMElementPtr &element, UINT childLevel)
{
CString text(_T("\r\n"));
for (UINT i = 0;i < childLevel;i++)
text += "\t";
element->appendChild(pDoc->createTextNode((_bstr_t)text));
}
示例11: SetData
/******************************************************************************
Function Name : SetData
Input(s) : MSXML2::IXMLDOMElementPtr& pIDomVerifyNode
Output : HRESULT
Functionality : Creates the XML file with pIDomVerifyNode
Member of : CVerify_MessageEntity
Friend of : -
Author(s) : Venkatanarayana Makam, GT-Derka
Date Created : 06/04/2011
Modifications :
******************************************************************************/
HRESULT CVerify_MessageEntity::SetData(MSXML2::IXMLDOMElementPtr& pIDomVerifyNode)
{
CString omstrTemp;
MSXML2::IXMLDOMDocumentPtr pIDOMDoc;
pIDOMDoc.CreateInstance(L"Msxml2.DOMDocument");
MSXML2::IXMLDOMElementPtr pChildElement, pSubElement;
if (pIDOMDoc != nullptr)
{
pChildElement = pIDOMDoc->createElement(_bstr_t(_(def_STR_VERIFYMSG_NODE)));
MSXML2::IXMLDOMAttributePtr pIDomTSAtrrib = pIDOMDoc->createAttribute(def_STR_TCATTRIB_ID);
if(pIDomTSAtrrib!= nullptr)
{
pIDomTSAtrrib->value = _bstr_t(m_ouData.m_dwMessageID);
pChildElement->setAttributeNode(pIDomTSAtrrib);
}
pIDomTSAtrrib = pIDOMDoc->createAttribute(_(def_STR_TCATTRIB_UNIT));
if(pIDomTSAtrrib!= nullptr)
{
switch(m_ouData.m_eSignalUnitType)
{
case ENG:
omstrTemp = "ENG";
break;
default:
case RAW:
omstrTemp = "RAW";
break;
}
pIDomTSAtrrib->value = _bstr_t(omstrTemp);
pChildElement->setAttributeNode(pIDomTSAtrrib);
}
pIDomTSAtrrib = pIDOMDoc->createAttribute(def_STR_TCATTRIB_CHANNEL);
if(pIDomTSAtrrib!= NULL)
{
pIDomTSAtrrib->value = _bstr_t(m_ouData.m_byChannelNumber);
pChildElement->setAttributeNode(pIDomTSAtrrib);
}
INT lCount = (INT)m_ouData.m_odSignalConditionList.GetCount();
for(INT i =0; i<lCount; i++)
{
POSITION pos = m_ouData.m_odSignalConditionList.FindIndex(i);
CSignalCondition& ouSignalData = m_ouData.m_odSignalConditionList.GetAt(pos);
pSubElement = pIDOMDoc->createElement(_bstr_t(_(def_STR_SIGNAL_NODE)));
pIDomTSAtrrib = pIDOMDoc->createAttribute(_(def_NAME_NODE));
pIDomTSAtrrib->value = _bstr_t(ouSignalData.m_omSigName);
pSubElement->setAttributeNode(pIDomTSAtrrib);
pSubElement->Puttext(_bstr_t(ouSignalData.m_omCondition));
pChildElement->appendChild(pSubElement);
}
pIDomVerifyNode->appendChild(pChildElement);
}
return S_OK;
}
示例12: SUCCEEDED
//-------------------------------------------------------------------------
// Function Name :EncodeBase64
// Parameter(s) :LPBYTE *pBuf The binary buffer
// :ULONG ulSize size
// Return :CString the result
// Memo :encoding the binary buffer into Base64 string
//-------------------------------------------------------------------------
CString CXml::Base64Encode(LPBYTE pBuf, ULONG ulSize)
{
ASSERT( m_pDoc != NULL );
ASSERT( pBuf != NULL );
CString strRet = _T("");
try
{
MSXML2::IXMLDOMElementPtr pElement = NULL;
pElement = m_pDoc->createElement( _bstr_t(_T("Base64")) );
ASSERT( pElement != NULL );
HRESULT hr = S_OK;
hr = pElement->put_dataType( _bstr_t(_T("bin.base64")) );
ASSERT( SUCCEEDED(hr) );
SAFEARRAY * pAry = SafeArrayCreateVector( VT_UI1, 0L, ulSize);
::memcpy( pAry->pvData, pBuf, ulSize);
VARIANT var;
VariantInit(&var);
var.parray = pAry;
var.vt = VT_ARRAY | VT_UI1;
pElement->nodeTypedValue = var;
BSTR bstr = NULL;
hr = pElement->get_text( &bstr );
ASSERT( SUCCEEDED(hr) );
strRet = (LPCTSTR)_bstr_t( bstr, true);
if( bstr != NULL )
{
SysFreeString(bstr);
bstr = NULL;
}
RELEASE_PTR(pElement);
}
catch ( _com_error e )
{
TRACE( _T("CXml::Base64Encode failed:%s\n"), e.ErrorMessage());
ASSERT( FALSE );
}
return strRet;
}
示例13: OnBnClickedLoadItem
//装入项目
void CUpdateBuilderDlg::OnBnClickedLoadItem()
{
CFileDialog dlg(TRUE, _T("*.xml"), _T("update.xml"), OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, _T("XML File(*.xml)|*.xml||"));
if (dlg.DoModal() == IDOK)
{
HRESULT hr = S_OK;
MSXML2::IXMLDOMDocumentPtr pXmlDoc;
MSXML2::IXMLDOMNodeListPtr pNodeList;
MSXML2::IXMLDOMElementPtr pElement;
try
{
hr = pXmlDoc.CreateInstance(__uuidof(MSXML2::DOMDocument30));
if( FAILED( hr ) )
_com_issue_error(hr);
pXmlDoc->load(CComVariant(dlg.GetPathName()));
pNodeList = pXmlDoc->selectNodes("/manifest/filelist/file");
m_FileListCtrl.DeleteAllItems();
LONG lItemCount = pNodeList->Getlength();
int nItem;
for (LONG lIndex = 0; lIndex < lItemCount; lIndex++)
{
pElement = pNodeList->Getitem(lIndex);
nItem = m_FileListCtrl.InsertItem(0, CString(pElement->getAttribute("filename")));
m_FileListCtrl.SetItemText(nItem, 1, CString(pElement->getAttribute("filesize")));
m_FileListCtrl.SetItemText(nItem, 2, CString(pElement->getAttribute("fileversion")));
m_FileListCtrl.SetItemText(nItem, 3, CString(pElement->getAttribute("md5")));
m_FileListCtrl.SetItemData(nItem, (ULONG)pElement->getAttribute("filesize"));
}
SetWindowText(dlg.GetPathName());
GetDlgItem(IDC_UPDATE_ITEM)->EnableWindow(TRUE);
}
catch(_com_error& e)
{
CString strError;
strError.Format(_T("Error code:%d\nError Message:%s\nError Description:%s"),
(int)e.WCode(), e.ErrorMessage(), (char*)e.Description());
MessageBox(strError, _T("错误"),MB_OK|MB_ICONSTOP);
}
}
}
示例14: Build
////////////////////////////////////////////////////////////////////////////
// Function: Create an XML DOM Document from Scratch in memory
////////////////////////////////////////////////////////////////////////////
HRESULT CXMLDocument::Build()
{
// Create a root node
MSXML2::IXMLDOMNodePtr pRoot;
m_pDoc->createNode(CComVariant(MSXML2::NODE_ELEMENT), CComBSTR("Root"), NULL, &pRoot);
// add child nodes
HRESULT hr = S_OK;
for (int i = 0; i < 10; i++)
{
MSXML2::IXMLDOMNodePtr pNode;
m_pDoc->createNode(CComVariant(MSXML2::NODE_ELEMENT), CComBSTR("Order"), NULL, &pNode);
MSXML2::IXMLDOMElementPtr pElement = pNode;
if (pElement != NULL)
pElement->setAttribute(CComBSTR("id"), CComVariant(i));
MSXML2::IXMLDOMNodePtr p0 = NULL;
CComVariant after;
hr = pRoot->insertBefore(pNode, after, &p0);
hr = CheckHR(hr, "inserting node");
// The XML Document should now own the node.
for (int j = 0; j < 10; j++)
{
MSXML2::IXMLDOMNodePtr pNode2;
m_pDoc->createNode(CComVariant(MSXML2::NODE_ELEMENT), CComBSTR("Item"), NULL, &pNode2);
MSXML2::IXMLDOMElementPtr pElement2 = pNode2;
if (pElement2 != NULL)
pElement2->setAttribute(CComBSTR("id"), CComVariant((i*10) + j));
MSXML2::IXMLDOMNodePtr p1 = NULL;
CComVariant after;
hr = p0->insertBefore(pNode2, after, &p1);
hr = CheckHR(hr, "inserting node");
// The XML Document should now own the node.
}
}
// Now attach this new subtree to the document.
m_pDoc->appendChild(pRoot, NULL);
return hr;
}
示例15: bAddChildToNode
/******************************************************************************
Function Name : bAddChildToNode
Input(s) : MSXML2::IXMLDOMElementPtr& pNodeElement,
CString omNodeName
CString omNodeval
Output : BOOL
Functionality :
Member of : CTestSetupEntity
Friend of : -
Author(s) : Venkatanarayana Makam
Date Created : 06/04/2011
Modifications :
******************************************************************************/
BOOL CTestSetupEntity::bAddChildToNode(MSXML2::IXMLDOMElementPtr& pNodeElement,
CString omNodeName, CString omNodeval)
{
BOOL bReturn = FALSE;
MSXML2::IXMLDOMElementPtr pChildElement;
MSXML2::IXMLDOMDocumentPtr m_pXMLDom;
m_pXMLDom.CreateInstance(L"Msxml2.DOMDocument");
if (pNodeElement != NULL)
{
pChildElement = m_pXMLDom->createElement(_bstr_t(omNodeName));
if (pChildElement != NULL)
{
pChildElement->Puttext((_bstr_t)omNodeval);
pNodeElement->appendChild(pChildElement);
bReturn = TRUE;
}
}
return bReturn;
}