Note that there are some explanatory texts on larger screens.

plurals
  1. POXML parsing error when callinng ReadXml for a DataSet
    text
    copied!<p>The code</p> <pre><code>XmlTextReader reader = new XmlTextReader("http://www.meloy.kommune.no/no/Abonner-pa-nyheter/Nyheter-Meloy-Kommune/"); DataSet ds = new DataSet(); ds.ReadXml(reader); </code></pre> <p>is causing this error when <code>ds.ReadXml</code> is called:</p> <blockquote> <p>System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy) at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver) at System.Threading.CompressedStack.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state) at System.Xml.XmlTextReaderImpl.OpenUrl() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlReader.MoveToContent() at System.Data.DataSet.ReadXml(XmlReader reader, Boolean denyResolving) at ASP.templates_units_rsslistingtest_ascx.LoadFeedServer(String url) at ASP.templates_units_rsslistingtest_ascx.SetupDataGridServer(Int32 max)</p> </blockquote> <p>What is the cause of the error and how do I resolve it?</p> <p>Edit: This works:</p> <pre><code>WebClient wc = new WebClient(); Stream st = wc.OpenRead("d:\\episerver\\test.xml"); string rss =""; using (StreamReader sr = new StreamReader(st)) { rss = sr.ReadToEnd(); } XmlReader reader = XmlReader.Create(new StringReader(rss)); DataSet ds = new DataSet(); ds.ReadXml(reader); </code></pre>
 

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