Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. XML parsing

XML parsing

Scheduled Pinned Locked Moved C / C++ / MFC
xmljsontutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Benjamin Bruno
    wrote on last edited by
    #1

    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

    C S 2 Replies Last reply
    0
    • B Benjamin Bruno

      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

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      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]

      1 Reply Last reply
      0
      • B Benjamin Bruno

        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

        S Offline
        S Offline
        ShilpiP
        wrote on last edited by
        #3

        click here ->[^]

        Yes U Can ...If U Can ,Dream it , U can do it ...ICAN

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups