Note that there are some explanatory texts on larger screens.

plurals
  1. PODeserialize an XML file - an error in xml document (1,2)
    primarykey
    data
    text
    <p>I'm trying to deserialize an XML file which I receive from a vendor with XmlSerializer, however im getting this exception: <code>There is an error in XML document (1, 2).InnerException Message "&lt;delayedquotes xmlns=''&gt; was not expected.</code>. I've searched the stackoverflow forum, google and implemented the advice, however I'm still getting the same error. Please find the enclosed some content of the xml file:</p> <pre><code>&lt;delayedquotes id="TestData"&gt; &lt;headings&gt; &lt;title/&gt; &lt;bid&gt;bid&lt;/bid&gt; &lt;offer&gt;offer&lt;/offer&gt; &lt;trade&gt;trade&lt;/trade&gt; &lt;close&gt;close&lt;/close&gt; &lt;b_time&gt;b_time&lt;/b_time&gt; &lt;o_time&gt;o_time&lt;/o_time&gt; &lt;time&gt;time&lt;/time&gt; &lt;hi.lo&gt;hi.lo&lt;/hi.lo&gt; &lt;perc&gt;perc&lt;/perc&gt; &lt;spot&gt;spot&lt;/spot&gt; &lt;/headings&gt; &lt;instrument id="Test1"&gt; &lt;title id="Test1"&gt;Test1&lt;/title&gt; &lt;bid&gt;0&lt;/bid&gt; &lt;offer&gt;0&lt;/offer&gt; &lt;trade&gt;0&lt;/trade&gt; &lt;close&gt;0&lt;/close&gt; &lt;b_time&gt;11:59:00&lt;/b_time&gt; &lt;o_time&gt;11:59:00&lt;/o_time&gt; &lt;time&gt;11:59:00&lt;/time&gt; &lt;perc&gt;0%&lt;/perc&gt; &lt;spot&gt;0&lt;/spot&gt; &lt;/instrument&gt; &lt;/delayedquotes&gt; </code></pre> <p>and the code</p> <pre><code>[Serializable, XmlRoot("delayedquotes"), XmlType("delayedquotes")] public class delayedquotes { [XmlElement("instrument")] public string instrument { get; set; } [XmlElement("title")] public string title { get; set; } [XmlElement("bid")] public double bid { get; set; } [XmlElement("spot")] public double spot { get; set; } [XmlElement("close")] public double close { get; set; } [XmlElement("b_time")] public DateTime b_time { get; set; } [XmlElement("o_time")] public DateTime o_time { get; set; } [XmlElement("time")] public DateTime time { get; set; } [XmlElement("hi")] public string hi { get; set; } [XmlElement("lo")] public string lo { get; set; } [XmlElement("offer")] public double offer { get; set; } [XmlElement("trade")] public double trade { get; set; } public delayedquotes() { } } </code></pre>
    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