Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

Getting node values separately using msxml parser in vc++?

$
0
0

In the below example how can i get the text values separately like : { {i am parent text}, {i am child1}, {i am child2}, {with above childs} } using {get_nodeValue} property in MSXML using c++ : {<rootElement>} {<parent>i am parent text} {<child_1>i am child1</child_1>} {<child_2>i am child2</child_2>} {with above childs} {</parent>} {</rootElement>} here when i am using {get_nodeValue()} for the {parent} element, i am getting null as it is of NODE_ELEMENT type. i have referred following link :

<https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms756022(v%3Dvs.85)>

Here is the code used:

ParseCurrentNode(IXMLDOMNode* CurrentNode) { VARIANT nValNode; BSTR bstrNodeText; CString strNodeText; Nodevalue->get_text(&bstrNodeText); strNodeText = bstrNodeText; SysFreeString(bstrNodeText); HRESULT temphr=FormatNode->get_nodeValue(&nValNode); } result is: strNodeText (concatenated string)="i am parent text i am child1 i am child2 with above childs" nValNode = null; Here CurrentNode is "parent":<rootelement><parent>i am parent text<child1>i am child 1</child1><child2>i am child 2</child2>

with above childs

</rootelement>


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>