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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:55:04+00:00 2026-06-04T11:55:04+00:00

<Root xmlns=http://tempuri.org/DataSourceSchemaConfig.xsd> <Node> <Name>Peter</Name> </Node> <Node> <Name>John</Name> </Node> </Root> How do I get List

  • 0
<Root xmlns="http://tempuri.org/DataSourceSchemaConfig.xsd">
 <Node>
  <Name>Peter</Name>
 </Node>
 <Node>
  <Name>John</Name>
 </Node>
</Root>

How do I get List of Names?

I’ve was trying this, but it doesn’t work, where is my mistake?

            var lists = from node in nodes.Descendants()
                        where node.Name.LocalName.Equals("Node")
                        select node.Elements("Name").First().Value;

L.B SOLUTION WORKS ONLY IF I REMOVE xmlns=”http://tempuri.org/DataSourceSchemaConfig.xsd&#8221; from my ROOT tag.

  • 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-04T11:55:06+00:00Added an answer on June 4, 2026 at 11:55 am
     XDocument xDoc = XDocument.Load(....);
     var names = xDoc.Descendants("Name").Select(x => x.Value);
    

    –EDIT–

    XDocument xDoc = XDocument.Load(....);
    XNamespace ns = XNamespace.Get("http://tempuri.org/DataSourceSchemaConfig.xsd");
    var names = xDoc.Descendants(ns+"Name").Select(x => x.Value);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<root xmlns:h=http://www.w3.org/TR/html4/ xmlns:f=http://www.w3schools.com/furniture> <h:table> <h:tr> <h:td>Apples</h:td> <h:td>Bananas</h:td> </h:tr> </h:table> <f:table> <f:name>African Coffee Table</f:name> <f:width>80</f:width>
Suppose we have the following schema: <xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema> <xs:element name=root> <xs:complexType> <xs:sequence> <xs:element name=a_elements>
Below code is the response from the server: xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema><soap:Body><SendCardDetailsResponse xmlns=http://tempuri.org/><SendCardDetailsResult><ROOT xmlns=><DocumentElement><res-auth><auth-data count='1' ><**attribute
<?xml version=1.0 encoding=utf-8?> <Report p1:schemaLocation=TemplateXXX http://localhost?language=en Name=TemplateXXX xmlns:p1=http://www.w3.org/2001/XMLSchema-instance xmlns=TemplateXXX> <HEADER attr1=one attr2=two /> <Table
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 the following XML <ns0:Root xmlns:ns0=http://Map_Sample.Input_Schema> <Number1> </Number1> <Number2>11</Number2> <Number3>12</Number3> </ns0:Root> In this
I need to generate XML in the following form: <ns1:root xmlns:ns1=http://example.com/xmlns1 xmlns:ns2=http://example.com/xmlns2> <ns2:item ns2:param=value
main.xml <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/root android:layout_width=match_parent android:layout_height=wrap_content android:orientation=vertical > <LinearLayout android:id=@+id/horizontal android:layout_width=fill_parent
I have an xml document like this: <?xml version=1.0 encoding=UTF-8?> <foo:root xmlns:foo=http://abc.com# xmlns:bar=http://def.com xmlns:ex=http://ex.com>
Suppose I have this XML: <?xml version=1.0 encoding=UTF-8?> <root xmlns:foo=http://www.foo.com> <foo:one>Alpha</foo:one> <two foo:Dog=Yorkie>Bravo</two> <three>foo:Delta</three>

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.