Note that there are some explanatory texts on larger screens.

plurals
  1. POReading XML nodes from web service
    primarykey
    data
    text
    <p>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 <a href="http://api.chartlyrics.com/apiv1.asmx/" rel="nofollow">http://api.chartlyrics.com/apiv1.asmx/</a></p> <p>My issues are with reading the returned XML.</p> <p>The function SearchLyricDirect e.g. <a href="http://api.chartlyrics.com/apiv1.asmx/SearchLyricDirect?artist=michael%20jackson&amp;song=bad" rel="nofollow">http://api.chartlyrics.com/apiv1.asmx/SearchLyricDirect?artist=michael%20jackson&amp;song=bad</a> return the following xml:</p> <pre><code> &lt;GetLyricResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://api.chartlyrics.com/"&gt; &lt;TrackId&gt;0&lt;/TrackId&gt; &lt;LyricChecksum&gt;8a84ddec06f4fffe067edd2fdbece21b&lt;/LyricChecksum&gt; &lt;LyricId&gt;1710&lt;/LyricId&gt; &lt;LyricSong&gt;Bad&lt;/LyricSong&gt; &lt;LyricArtist&gt;Michael Jackson&lt;/LyricArtist&gt; &lt;LyricUrl&gt; http://www.chartlyrics.com/28h-8gWvNk-Rbj1X-R7PXg/Bad.aspx &lt;/LyricUrl&gt; &lt;LyricCovertArtUrl&gt; http://ec1.images-amazon.com/images/P/B000CNET66.02.MZZZZZZZ.jpg &lt;/LyricCovertArtUrl&gt; &lt;LyricRank&gt;9&lt;/LyricRank&gt; &lt;LyricCorrectUrl&gt; http://www.chartlyrics.com/app/correct.aspx?lid=MQA3ADEAMAA= &lt;/LyricCorrectUrl&gt; &lt;Lyric&gt; .......Lyric....... &lt;/Lyric&gt; &lt;/GetLyricResult&gt; </code></pre> <p>I have tried using a XmlReader but it says there are illegal characters e.g. XmlReader xmlr = XmlReader.Create(e.Result);</p> <p>I've tried using XDocument instead, but I cannot get any values out for elements under "GetLyricResult".</p> <pre><code> XDocument xmltest = XDocument.Parse(e.Result); Console.WriteLine(xmltest.Element("Lyric").Value); </code></pre> <p>I'm sure it is very simple.</p> <p>Thank you!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload