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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:00:53+00:00 2026-06-17T20:00:53+00:00

I have this xml file: http://www.studiovincent.net/list.xml I need parser with c#, to get values.

  • 0

I have this xml file: http://www.studiovincent.net/list.xml

I need parser with c#, to get values. Im using this code:

XmlReader xmlReader = XmlReader.Create("http://www.studiovincent.net/list.xml");
        while (xmlReader.Read())
        {
            if ((xmlReader.NodeType == XmlNodeType.Element) && (xmlReader.Name == "field"))
            {
                if (xmlReader.HasAttributes)
                    Console.WriteLine(xmlReader.GetAttribute("name") + ": " + xmlReader.GetAttribute("price"));
            }
        }
        Console.ReadKey();

but I get in OUTPUT this result:

name:
username:
age:
hair:
name:
username:
age:
hair:
name:
username:
age:
hair:

How Can I get this result?

Vincent
Hill
31
black
John
Tedelon
27
brown
Michael
Lopez
20
red
Frank
Lopez
25
black

and this result?

 Vincent
 John
 Michael
 Frank

Thanks in advance!

  • 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-17T20:00:54+00:00Added an answer on June 17, 2026 at 8:00 pm

    The following code will give you, your first result:

            using System.Xml;
            using.System.Xml.Linq;
    
            XmlReader reader = XmlReader.Create("http://www.studiovincent.net/list.xml");
            XElement el = XElement.Load(reader);
            reader.Close();
    
            var items = el.Elements("resources").Elements("resource").Descendants().DescendantNodes();
    
            foreach (XNode node in items)
            {
                Console.WriteLine(node.ToString());
            }
    

    The following code will give you, your second result

            var items = from item in el.Elements("resources").Elements("resource").Descendants() where item.Attribute("name").Value == "name" select item.FirstNode;
    
            foreach (XNode node in items)
            {
                Console.WriteLine(node.ToString());
            }
    
    • 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: http://www.studiovincent.net/list.xml I need copy whole content in other xml
I have this xml file: Response: <ns3:ExecuteResponse xmlns:ns3=http://www.opengis.net/wps/1.0.0 xmlns:ns1=net/ows/1.1 xmlns:ns2=http://www.w3.org/1999/xlink statusLocation=xxxxf62 serviceInstance=http:/http-post version=1.0.0 service=xxx>
I have this XML at http://localhost/file.xml : <?xml version=1.0 encoding=utf-8?> <val:Root xmlns:val=http://www.hw-group.com/XMLSchema/ste/values.xsd> <Agent> <Version>2.0.3</Version>
I have this xml file <?xml version=1.0 encoding=UTF-8?> <bo:C837ClaimParent xsi:type=bo:C837ClaimParent xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:bo=http://somelongpathHere/process/bo> <claimAux> ...
I have xml file like this <?xml version=1.0 encoding=UTF-8?> <specification xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:noNamespaceSchemaLocation=file://Desktop/normal.xsd> <university> <refstr>bdvl_te_skrm_stc</refstr>
I have this XML file: http://www.basket.ba/ksbih/xml/200_07.xml I've used all the major functions and classes
I have this XML file: <?xml version=1.0?> <xi:include href=http://www.w3schools.com/dom/books.xml xmlns:xi=http://www.w3.org/2003/XInclude/> and I expected that
I have the following xml file <kml xmlns=http://www.opengis.net/kml/2.2 xmlns:gx=http://www.google.com/kml/ext/2.2 xmlns:kml=http://www.opengis.net/kml/2.2 xmlns:atom=http://www.w3.org/2005/Atom> <Placemark> <name>Simple placemark</name>
I have this website i need to parse for an android app. http://www.wow-coupons.com/rss_online_coupons.xml I
I have this XML file: <movie id = 0> <Movie_name>The Shawshank Redemption </Movie_name> <Address>http://www.imdb.com/title/tt0111161/

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.