XML : Error De-serializing XML

I have the class structure like:

  [XmlRoot(ElementName = "DocumentElement", Namespace = "")]          public class Message          {              public Person person;              public class Person              {                  public int Age{ get; set; } // readonly                  public String Name { get; set; }              }          }    

Then I pass the following xml to the class to deserialize:

  <DocumentElement>   <person>    <Age>13</Age>    <Name>My Name</Name>   </person>  </DocumentElement>    

No matter I put the xml header on or off, always returns the same error:

there is an error in xml document (5, 4)

Anyone please help to have a check

No comments:

Post a Comment