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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:32:12+00:00 2026-05-27T05:32:12+00:00

I am reading an xmlfile via the XDocument class. The XML has namespaces in

  • 0

I am reading an xmlfile via the XDocument class. The XML has namespaces in it, how do I use node.Element() with a namespace? I tried creating XNamespace but it didn’t seem to work..

The XML is as follows:

<CueList time="2011-12-02T13:34:39" xmlns="urn:CueListSchema.xml" xmlns:s="urn:schemas-rcsworks-com:SongSchema" xmlns:n="urn:schemas-rcsworks-com:NoteSchema" xmlns:l="urn:schemas-rcsworks-com:LinkSchema" xmlns:t="urn:schemas-rcsworks-com:TrafficSchema" xmlns:p="urn:schemas-rcsworks-com:ProductSchema" xmlns:m="urn:schemas-rcsworks-com:MediaSchema" xmlns:w="urn:schemas-rcsworks-com:WebPageSchema" xmlns:ns="urn:CueListSchema.xml">
  <Event eventID="14" eventType="song" status="happening" scheduledTime="13:34:38" scheduledDuration="332.82">
    <s:Song title="Long Time Coming (Holding On)" internalID="007700028007AD480000">
      <s:Artist name="The Winans" sequenceNumber="1" internalID="0067000180002B020000" sortName="Winans, The" />
      <m:Media ID="{7C734B6C-7AF7-4998-8366-F1F11F5D56D7}" runTime="332.82" fileName="{7C734B6C-7AF7-4998-8366-F1F11F5D56D7}.wav" />
    </s:Song>
  </Event>
  <Event eventID="15" eventType="link" status="committed" startTime="13:40:10" scheduledDuration="3.49">
    <l:Link title="PG MFL DRY FEMALE" internalID="007B00028002DAEA0000">
      <m:Media ID="{036BB0ED-3130-4AD0-8BAF-E5D0FBA7DC3B}" runTime="3.49" fileName="{036BB0ED-3130-4AD0-8BAF-E5D0FBA7DC3B}.wav" />
    </l:Link>
  </Event>
  <Event eventID="16" eventType="song" status="committed" startTime="13:40:10" scheduledDuration="303.55">
    <s:Song title="Not Making Sense, Making Faith" internalID="007700028009377F0000">
      <s:Artist name="Donald Lawrence" sequenceNumber="1" internalID="006700018000308A0000" sortName="Lawrence, Donald" />
      <m:Media ID="{B6FD04EA-9B42-4E6A-AC80-A26BF65E6F11}" runTime="303.55" fileName="{B6FD04EA-9B42-4E6A-AC80-A26BF65E6F11}.wav" />
    </s:Song>
  </Event>
</CueList>

I am looping from the nodes in a foreach and want to get the s:Song node.

  • 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-27T05:32:13+00:00Added an answer on May 27, 2026 at 5:32 am

    Nice and easy with LINQ to XML using XNamespace and its overload of the addition operator:

    XNamespace ns = "urn:schemas-rcsworks-com:SongSchema";
    for (var songElement = doc.Descendants(ns + "Song"))
    {
        ...
    }
    

    The simple handling of namespaces is one of the most beautiful aspects of LINQ to XML.

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

Sidebar

Related Questions

I'm reading an xml file with PHP and pulling it into jQuery via a
I am reading an XML file into a DataSet and need to get the
I'm reading an xml file and want to make it from a relative directory
I am reading an xml file using javascript and then I need to submit
I'm using Qt C++ and am reading in an XML file for data. I
how do i ignore exceptions in c#? i am reading a remote xml file,
While implementing XML file reading/writing in my application I saw that when I call
My asp.net web application is reading and decrypting the password from a XML file
I have a datagrid that is populated via XML file when the form loads.
I have a flash file with an xml file as flashvars. when I use

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.