XML parsing
-
Hi In my code I am parsing XML using MSXML .But I am not able to get Node values using MSXML .How to read the node values?
IXMLDOMNode\* nodeVal; CString csXMLValue; BSTR bsSelectedNodeItemName; hResult = pChildNodeList->get\_item( nIdx, &nodeVal ); hResult = nodeVal->get\_nodeName(&bsSelectedNodeItemName); if ( 0 == \_tcscmp( OLE2T( bsSelectedNodeItemName ), L"User" ) ) { nodeVal->get\_nodeValue(&**vtNodeValue**); }
but vtNodeValue is NULL .My XML node structure is
<User >2700</User>
<User>3700</User>I want to read the node values ie,2700 and 3700
thanks in advance
-
Hi In my code I am parsing XML using MSXML .But I am not able to get Node values using MSXML .How to read the node values?
IXMLDOMNode\* nodeVal; CString csXMLValue; BSTR bsSelectedNodeItemName; hResult = pChildNodeList->get\_item( nIdx, &nodeVal ); hResult = nodeVal->get\_nodeName(&bsSelectedNodeItemName); if ( 0 == \_tcscmp( OLE2T( bsSelectedNodeItemName ), L"User" ) ) { nodeVal->get\_nodeValue(&**vtNodeValue**); }
but vtNodeValue is NULL .My XML node structure is
<User >2700</User>
<User>3700</User>I want to read the node values ie,2700 and 3700
thanks in advance
What you (and common sense) call 'node value' of
User
is actually just its child, another (text) node. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Hi In my code I am parsing XML using MSXML .But I am not able to get Node values using MSXML .How to read the node values?
IXMLDOMNode\* nodeVal; CString csXMLValue; BSTR bsSelectedNodeItemName; hResult = pChildNodeList->get\_item( nIdx, &nodeVal ); hResult = nodeVal->get\_nodeName(&bsSelectedNodeItemName); if ( 0 == \_tcscmp( OLE2T( bsSelectedNodeItemName ), L"User" ) ) { nodeVal->get\_nodeValue(&**vtNodeValue**); }
but vtNodeValue is NULL .My XML node structure is
<User >2700</User>
<User>3700</User>I want to read the node values ie,2700 and 3700
thanks in advance