Hello had written a small function for xml creation.
CreateElementNode(std::wstring name,std::wstring value) { if(pXMLRootElem!=NULL) { MSXML::IXMLDOMElementPtr pXMLChild1 = pDocument->createElement(name.c_str()); if(pXMLChild1) { if(!value.empty()) pXMLChild1->Puttext(value.c_str()); pXMLChild1 = pXMLRootElem->appendChild(pXMLChild1); } return E_FAIL; } else return E_FAIL; return S_OK; }
and I am calling this function like
CString szStart = _T("This name"); xml1.CreateElementNode((LPCWSTR)szStart,(LPCWSTR)szStart,pParent1);
And here comes the actual problem when i remove space between This and nameeverything works fine . But with space this get crashed in pDocument->createElement . here i am confused why i tried with BSTR AllocSysString etc but in all cases with space pDocument->createElement is getting crashed anyone know what is the issue here.
I am using Dom Parser here
MSXML::IXMLDOMDocumentPtr pDocument;
MSXML::IXMLDOMElementPtr pXMLRootElem;
Thanks
Rupesh Shukla