Note that there are some explanatory texts on larger screens.

plurals
  1. POExpecting element 'CustomerLeads' from namespace 'http://www.w3.org/2001/XMLSchema-instance'
    primarykey
    data
    text
    <p>Im getting the following error when running my application: Additional information: Error in line 2 position 64. Expecting element 'CustomerLeads' from namespace '<a href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow">http://www.w3.org/2001/XMLSchema-instance</a>'.. Encountered 'Element' with name 'CustomerLeads', namespace ''. </p> <p>I dont understand why I am getting this error message because as you can see from the XML 'CustomerLeads' is included within the XML. If I take out the namespace the file will not read the Elements. Including the namespace seems to work but cant seem to figure out why I am getting this error. And how I can add the namespace without getting this error?</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;CustomerLeads xsi:noNamespaceSchemaLocation="BasicCustomerLead.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt; &lt;CustomerLead&gt; &lt;FirstName&gt;Paul&lt;/FirstName&gt; &lt;LastName&gt;Smith&lt;/LastName&gt; &lt;Email&gt;psmith@example.com&lt;/Email&gt; &lt;/CustomerLead&gt;-&lt;CustomerLead&gt; &lt;FirstName&gt;Nicole&lt;/FirstName&gt; &lt;LastName&gt;Farhi&lt;/LastName&gt; &lt;Email&gt;nicole.farhi@example.com&lt;/Email&gt; &lt;/CustomerLead&gt;-&lt;CustomerLead&gt; &lt;FirstName&gt;Raf&lt;/FirstName&gt; &lt;LastName&gt;Simons&lt;/LastName&gt; &lt;Email&gt;rafs@example.org&lt;/Email&gt; &lt;/CustomerLead&gt; &lt;/CustomerLeads&gt; </code></pre> <p>Code:</p> <pre><code>namespace Customer { [DataContract(Name = "CustomerLeads", Namespace = "http://www.w3.org/2001/XMLSchema-instance")] public class CustomerLeads { [DataMember()] public string FirstName { get; set; } [DataMember()] public string LastName { get; set; } [DataMember()] public string EmailAddress { get; set; } public CustomerLeads unSortedLeads(string xmFilelPath) { // doc.Load("C:/Users/Admin/Downloads/potentialcustomers.xml"); ICollection&lt;CustomerLeads&gt; deserializedPerson; CustomerLeads lead; FileStream fs = new FileStream(xmFilelPath, FileMode.Open); XmlDictionaryReader reader = XmlDictionaryReader.CreateTextReader(fs, new XmlDictionaryReaderQuotas()); DataContractSerializer ser = new DataContractSerializer(typeof(CustomerLeads)); lead = (CustomerLeads)ser.ReadObject(reader, true); reader.Close(); fs.Close(); FirstName = lead.FirstName.ToString(); // foreach(CustomerLeads leads in deserializedPerson.) return lead; } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    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