I use function mdlXMLDomElement_getValue get xml node value ok.
But use mdlXMLDomElement_setValue update xml node value fail.
How to update xml node value?such as update 85 to 100.
xml define:
<rootNode>
<ChildNode>
<value Var="test">85</value> </ChildNode> </rootNode>
My code:
if(SUCCESS==mdlXMLDomNode_selectSingleNode (&symbNodeRef,rootNodeRef,pNodeName)) {
if(SUCCESS == mdlXMLDomNodeList_getNextChildElement(&ChildNodeRef, NULL, &nodeListRef, symbNodeRef))
{ MSWChar pKeyString[256], pValueString[256]; int KeyMaxLen = 256,ValueMaxLen = 256; char keyString[256];
mdlXMLDomElement_getAttribute(pKeyString, &KeyMaxLen, ChildNodeRef, L"Var", XMLDATATYPE_WIDESTRING); mdlCnv_convertUnicodeToMultibyte(pKeyString, -1, keyString, 1024); if (0 == strcmp(pInKey, keyString)) { int iTest=100;
char buf[20]; sprintf_s(buf,"%d",iTest);
mdlCnv_convertMultibyteToUnicode(buf, -1, pValueString, ValueMaxLen); mdlXMLDomElement_setValue (ChildNodeRef, pValueString); }
}
Thanks!