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

  • SEARCH
  • Home
  • 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 8185777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:57:57+00:00 2026-06-07T01:57:57+00:00

How to extract the value from a xml tag? Below is the XML which

  • 0

How to extract the value from a xml tag?
Below is the XML which is stored in a pointer variable response.

<Response>
<ID>App1</ID>
<operationID>654164615</operationID>
<mainReturnResult>
<returnCode>2000</returnCode>
<returnString> Success – Successful Result </returnString>
</mainReturnResult>
<totalDuration>647</totalDuration>
<Result>
<jobID>job1</jobID>
<mainReturnResult>
<returnCode>2000</returnCode>
<returnString> Success – Successful Result </returnString>
</mainReturnResult>
<duration>78</duration>
/*still more xml tags*/

-Data.to.be.taken
        data comes here which have to extracted
-Done.with.data

I need only the return code and the data which is at the end of the xml.
I was using strstr to get the value of the tag return code. But when my friend seeing me doing that he said its a bad way to do it.
But, I need only the
1. return code to know the status and
2. to extract the data from the xml.

So, can you please suggest me which is the efficient way of doing these two activities without using any libraries.

  • 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-07T01:57:59+00:00Added an answer on June 7, 2026 at 1:57 am

    Just parse it.

    While I’ve written a lot of code for parsing stuff like this (mostly in C#), you can do something really simple here.

    Just scan the text for <returnCode>. The text you want starts after this. It ends at the next occurrence of </returnCode>. Easy.

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

Sidebar

Related Questions

How do I extract the data from that XML object, which is a value
I am trying to extract a value from an xml element, located in an
I'm trying to extract the StateLongName and StateShortName values from the xml below. I
How can i extract key value pairs from this xml example using linq: <foo>
I managed to extract a value from a XML file: <--more labels up this
Using PHP Regular Expression I want to extract some value from code <?xml version=1.0
I am running the below query to extract data from an xml column...question is
I would like to extract a single value from a large xml file (part
I have an xml feed, which i'm attempting to extract two values from. I'll
Struggling in vain to extract the value of the Status descendant from an XML

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.