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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:23:44+00:00 2026-05-24T14:23:44+00:00

A pretty newbie question as I rarely work with XML. I’m trying out writing

  • 0

A pretty newbie question as I rarely work with XML. I’m trying out writing stuff for the Subsonic API. The xml looks like this

<?xml version="1.0" encoding="UTF-8"?>
<subsonic-response xmlns="http://subsonic.org/restapi" status="ok" version="1.6.0">
  <indexes lastModified="1313158157783">
    <index name="A">
      <artist name="Albums" id="5c5c3139322e3136382e322e31305c566f6c756d655f315c4d757369635c416c62756d73"/>
    </index>
    <index name="S">
      <artist name="Singles" id="5c5c3139322e3136382e322e31305c566f6c756d655f315c4d757369635c53696e676c6573"/>
    </index>
  </indexes>

</subsonic-response>

I’m just trying to get the index nodes.

I’m trying this, but not sure if I am doing this right. Both the SelectNodes and SelectSingleNode are returning emtpy. I’m sure I am missing something simple.

XmlNamespaceManager nsmgr = new XmlNamespaceManager(index.NameTable);
nsmgr.AddNamespace("", "http://subsonic.org/restapi");

XmlNodeList xnList = index.SelectNodes("/subsonic-response/indexes/index", nsmgr);
XmlNode mainnode = index.SelectSingleNode("/subsonic-response", nsmgr);

foreach (XmlNode xn in xnList)
{
}

I’ve tried with and without the namespacemanager and it’s the same thing

  • 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-24T14:23:46+00:00Added an answer on May 24, 2026 at 2:23 pm

    Try using a non-empty XML namespace prefix:

    XmlNamespaceManager nsmgr = new XmlNamespaceManager(index.NameTable);
    nsmgr.AddNamespace("x", "http://subsonic.org/restapi");
    
    XmlNodeList xnList = index.SelectNodes("/x:subsonic-response/x:indexes/x:index", nsmgr);
    XmlNode mainnode = index.SelectSingleNode("/x:subsonic-response", nsmgr);
    

    I’ve had trouble with trying to use the empty string as a (default) XML namespace prefix

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

Sidebar

Related Questions

Simple newbie question, I am starting out with nodejs, and I am pretty new
This is probably a really newbie question (well, I'm pretty sure it is), but
i am pretty newbie in terms of flex/RIA frameworks. mostly done work on server
This is a pretty newbie question- please know I'm aware of that. I have
I hope someone can help me. It's a pretty newbie question, I'm afraid. I
Sorry for the newbie question, but I can't seem to figure this out. I
This is a pretty simple question: as a Git newbie I was wondering if
This might be a pretty simple question but I'm a Crystal Reports newbie...I have
I guess this is a pretty newbie question, but I've spent only 2 weeks
I am pretty newbie by this question. I want to know about possibilities of

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.