Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8242043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:02:22+00:00 2026-06-07T21:02:22+00:00

I want to get the node values of the xml string in a visual

  • 0

I want to get the node values of the xml string in a visual c++ code

My vc++ code is something like this

url= _T(“http://www.xyz.com/val”);
CString result = g_pCAddonHandler->SendWebRequest(url, L”GET”, L””, false);
// I send a request to a web url it returns an xml string and the format of xml is below

response

result name=”response” numFound=”1″ start=”0″

doc

str name=”id”>497888/str

str name=”lastName” Ross /str

str name=”name” Holly /str

/doc

/result

/response

Note:- I have not used < & > because stackoverflow doesn’t allow these.

Please help in getting all the nodes.
I am relatively new in VC++.

Regards
Anil

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T21:02:25+00:00Added an answer on June 7, 2026 at 9:02 pm

    Try this

    MSXML2::IXMLDOMDocumentPtr pXMLDom;
    IXMLDOMNodeListPtr itemNodes = NULL;
    CComBSTR bstrResp(szResponse);
    ::CoCreateInstance(MSXML2::CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,
            MSXML2::IID_IXMLDOMDocument, (void**)&pXMLDom);
    BOOL bRet = pXMLDom->loadXML((BSTR) bstrResp);
    
    
    if(bRet)
    {
     itemNodes = pXMLDom->selectNodes(_T( "/response/result/doc/str[@name='id']"));
     CString szId =  itemNodes->item[0]->text
     ....
    
    }
    

    for details check this

    http://msdn.microsoft.com/en-us/library/windows/desktop/ms756987%28v=vs.85%29.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this xml file and I want to get some values with Xpath.
I want to get to the exact node having this text: 'Company'. Once I
What I want: get a xml from the AppData to use What I code
Suppose I have this XML document... <root> <str name=My node's attribute>My string's value</str> </root>
Based on this , it looks like each time I want to get a
I have some XML that looks like this: <abc x={></abc> I want to force
I m using the code below to get value of node from a XML
I am using HTMLAgilityPack in my application, and i want to get the item(node)
My question is, that how can I get the node in witch I want
i want query a file xml with linq, i want get all descendat of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.