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 6596973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:08:55+00:00 2026-05-25T18:08:55+00:00

I have XML that is being returned back from a rest service WCF. The

  • 0

I have XML that is being returned back from a rest service WCF. The following is an example of the XML

<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">
<catalog version="1.1"><dataset id="354" name="Mariano - Ship Drift" description="Global Currents, Static" datatype="currents" rank="5" saropsrank="4" format="netcdf" starttime="1980-01-01T00:00:00" endtime="2019-01-01T00:00:00" extentleft="-180.0000" extentbottom="-90.0000" extentright="180.0000" extenttop="90.0000" source="STATIC" wmslayeridstr="MARIANO_currents" confidence="L" directionfrom="no" image="ne_ndbc.jpg" />
</catalog>
</string>

I need to get the value from id, name, description, etc… and put it into a list or a listbox.

WebResponse response = restWebRequest.GetResponse();
Stream responseStream = response.GetResponseStream();

Reponse stream is the stream that holds the XML.

Any ideas?

  • 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-05-25T18:08:56+00:00Added an answer on May 25, 2026 at 6:08 pm
    XDocument doc = XDocument.Load(responseStream);
    
    var elem = doc.Descendants().FirstOrDefault(el => el.Name.LocalName == "dataset");
    if(elem != null)
    {
        var attID = elem.Attribute("id");
        if(attID != null)
            Console.WriteLine(attID.Value);
    }
    

    OR

    You could directly get the IEnumerable with an anonymous type:

    XDocument doc = XDocument.Parse(xml);
    
    var values = doc.Descendants("dataset")
                    .Select(el => new { id = el.Attribute("id").Value, 
                                        name = el.Attribute("name").Value 
                                      }
                     );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have XML that looks something like this: <Root xmlns=http://widgetspecA.com/ns> ...any... <WidgetBox> <A/> <B/>
I have a WordPress template that contains the following element: <html xmlns=http://www.w3.org/1999/xhtml <?php language_attributes('xhtml');
I have an XML document that's being generated from some content that people are
I have a stream of xml being returned from a webservice which is coming
I have to make a schema for an XML format that's already being used.
My question is the following. I have xml that is versioned by a namespace.
I have an xml being returned by an extension method. Can some please help
I have some xml being returned in sharepoint, Im using xslt to create the
I have the following Python regex: xml_parse = re.search(r'^.+?<Hit_accession>(\w+?)</Hit_accession>.+?<Hsp_qseq>(\w+?)</Hsp_qseq>\s+?<Hsp_hseq>(\w+?)</Hsp_hseq>\s+?<Hsp_midline>(.+?)</Hsp_midline>',string,flags=re.DOTALL) for the following text: <?xml
I have a legacy CGI web service that returns XML. I have added logging

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.