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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:57:24+00:00 2026-05-27T08:57:24+00:00

I have been playing around with a simple application for Windows Phone 7 using

  • 0

I have been playing around with a simple application for Windows Phone 7 using web services over http with XML responses.
I’m using the following API http://api.chartlyrics.com/apiv1.asmx/

My issues are with reading the returned XML.

The function SearchLyricDirect e.g. http://api.chartlyrics.com/apiv1.asmx/SearchLyricDirect?artist=michael%20jackson&song=bad return the following xml:

   <GetLyricResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://api.chartlyrics.com/">
          <TrackId>0</TrackId>
          <LyricChecksum>8a84ddec06f4fffe067edd2fdbece21b</LyricChecksum>
          <LyricId>1710</LyricId>
          <LyricSong>Bad</LyricSong>
          <LyricArtist>Michael Jackson</LyricArtist>
          <LyricUrl>
                 http://www.chartlyrics.com/28h-8gWvNk-Rbj1X-R7PXg/Bad.aspx
          </LyricUrl>
          <LyricCovertArtUrl>
                 http://ec1.images-amazon.com/images/P/B000CNET66.02.MZZZZZZZ.jpg
          </LyricCovertArtUrl>
          <LyricRank>9</LyricRank>
          <LyricCorrectUrl>
                 http://www.chartlyrics.com/app/correct.aspx?lid=MQA3ADEAMAA=
          </LyricCorrectUrl>
          <Lyric>
                    .......Lyric.......
          </Lyric>
   </GetLyricResult>

I have tried using a XmlReader but it says there are illegal characters e.g. XmlReader xmlr = XmlReader.Create(e.Result);

I’ve tried using XDocument instead, but I cannot get any values out for elements under “GetLyricResult”.

  XDocument xmltest = XDocument.Parse(e.Result);
  Console.WriteLine(xmltest.Element("Lyric").Value);

I’m sure it is very simple.

Thank you!

  • 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-27T08:57:26+00:00Added an answer on May 27, 2026 at 8:57 am

    You’re not paying attention to the XML namespace that’s defined!

    <GetLyricResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                    xmlns="http://api.chartlyrics.com/">
    

    What you need to do is define that XML namespace in your Linq-to-XML query, too:

     XDocument xmltest = XDocument.Parse(e.Result);
     XNamespace ns = "http://api.chartlyrics.com/";
    
     Console.WriteLine(xmltest.Element(ns + "GetLyricResult").Element(ns + "Lyric").Value);
    

    Also: your code wasn’t gonna work anyway – if you use .Element, you need to reference all elements from the root on – so here you first need to “resolve” the <GetLyricResult> root node, and only after that, you can reach in and grab the <Lyric> node

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

Sidebar

Related Questions

I have been playing around a bit with a fairly simple, home-made search engine,
I have been playing around with the MVP pattern using winforms for the last
I'm playing around with building a new web application using DB4O - piles of
I have been playing around with writing some simple card games in Python for
I've been playing around a bit with the Tornado web server and have come
I've been playing around with Simple.Data and have run across something that I can't
I have been playing around with the postgresql.conf file for a couple days now.
I have been playing around with the EF to see what it can handle.
I have been playing around with the MS Source Server stuff in the MS
I have been playing around with the Rhino ETL library and really like the

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.