Note that there are some explanatory texts on larger screens.

plurals
  1. PONotSupportedException when trying to parse plist document
    primarykey
    data
    text
    <p>I'm currently working on a Windows Phone 7 Application for the company I work for. For the configuration part I'd like to share the configuration that is used for our iPhone Application and stored on a remote server in a plist file. </p> <p>I use <code>System.Xml.Linq.XDocument</code> to <code>Parse</code> a string I downloaded using a WebClient instance.</p> <p>This is the code:</p> <pre><code> Uri plistLocation = new Uri(@"http://iphonevnreporter.vol.at/Settings.bundle/mw_test.plist"); WebClient client = new WebClient(); try { client.DownloadStringCompleted += ((sender,e) =&gt; { if (e.Error == null) { XDocument xdoc = XDocument.Parse(e.Result); //XElement element = XElement.Parse(e.Result.ToString()); var dictItems = xdoc.Descendants("dict"); foreach (XElement elem in dictItems) { } } }); } catch (Exception e) { } client.DownloadStringAsync(plistLocation); </code></pre> <p>In this example the plist is just having a <code>dict</code> Element under the root <code>plist</code> element and nevertheless I am receiving the <code>NotSupportedException</code>. The Exception occurs at <code>XDocument.Parse(e.Result)</code>.</p> <p>This is the StackTrace:</p> <pre><code> at System.Xml.XmlTextReaderImpl.ParseDoctypeDecl() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.Linq.XDeclaration..ctor(XmlReader r) at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options) at System.Xml.Linq.XDocument.Parse(String text) at VorarlbergOnline.MainViewModel.&lt;FillSections&gt;b__10( Object sender, DownloadStringCompletedEventArgs e) at System.Net.WebClient.OnDownloadStringCompleted (DownloadStringCompletedEventArgs e) at System.Net.WebClient.DownloadStringOperationCompleted(Object arg) at System.Threading.ThreadPool.WorkItem.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadPool.WorkItem.doWork(Object o) at System.Threading.Timer.ring() </code></pre> <p>Loading other XML files works fine, so the code seems to be ok. I checked if the referenced dtd could be the problem, but it loads fine. So I'm kind of out of ideas now.</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