get xml text in character pointer format

Hi all,

I am facing a problem in parsing a xml. The structure of xml is

< root>
<node>
<child>abc </ child>
<child>def< / child>
</node>
<node>
<child>ghi</child>
<child>jkl</child>
</node>
</root>


I am putting a loop for parsing the xml but it is not working

for (IXMLDOMNodePtr pChild = node->firstChild; pChild != NULL; pChild = pChild->nextSibling) {
char* result;

if ( strcmp(pChild->nodeName, " Child" ) == 0 ) {
<u>char* str = pChild->text</ u>;
sprintf( targetStr, str );
sprintf( result, " %dName" , i+1);
SetEnvironmentVariable( result, targetStr);
}
}

It is giving an error

error C2451: conditional expression of type 'const struct MSXML2::IXMLDOMNodeList' is illegal
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:Program FilesMicrosoft Visual StudioMyProjectswintrayEnpaqStatuslinkState.cpp(67) : see reference to function template instantiation '__thiscall _com_ptr_t<class _com_IIID<struct MSXML2::IXMLDOMNode,&struct __s_GUID _GUID_2933bf80_7b36_11d2_b20e_00c04f983e60>>

My Problem is How to convert the structure type into const char*


Thanks in advance
Topic archived. No new replies allowed.