Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to parse XML in a Windows Phone 7 application
    primarykey
    data
    text
    <p>Could someone tell me how to parse a XML-String that i receive from a wcf-rest service?</p> <p>my webserive XML-String looks like</p> <pre><code>&lt;WS&gt; &lt;Info&gt; &lt;Name&gt;Beta&lt;/Name&gt; &lt;Description&gt;Prototyps&lt;/Description&gt; &lt;/Info&gt; &lt;Pages&gt; &lt;Page&gt; &lt;Name&gt;Custom&lt;/Name&gt; &lt;Description&gt;toDo&lt;/Description&gt; &lt;/Page&gt; ...many other pages... &lt;/Pages&gt; &lt;/WS&gt; </code></pre> <p>an my phone sourcecode:</p> <pre><code>public void DownloadCompleted(Object sender, DownloadStringCompletedEventArgs e) { if (!e.Cancelled &amp;&amp; e.Error == null) { var answer = XElement.Parse(e.Result).Descendants("WS"); // null ... } } </code></pre> <p>if i try to parse it through XDocument.Load(e.Result) then i get the exception: File not Found.</p> <p>i just want the "unique" information of the Info-Node and a list of all Page-Nodes with their values</p> <p><strong>Update</strong> Even if i try to load the Root-Element via var item = xdoc.Root.Descendants(); item will be assigned to the whole xml-file.</p> <p><strong>Update 2</strong> it seems the problem occurs with the namespaces in the root-element. with namespaces xdocument will parse the webservice output not correctly. if i delete the namespaces it works fine. could someone explain me this issue? and is there a handy solution for deleting all namespaces?</p> <p><strong>update 3</strong> A Handy way for removing namespaces<a href="http://bohu7.wordpress.com/2008/12/11/removing-default-namespaces-from-an-xdocument/" rel="nofollow">1</a></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.
 

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