c# - Xml without root deserialization -


i have xml looks

 <root> <logentry>     <data1> </data1>     <data2> </data2> </logentry> <logentry>     <data1> </data1>     <data2> </data2> </logentry>  </root> 

and class looks

[xmlroot("root")] public class logentries {     [xmlelement("logentry")]     public list<clientlogentry> entries { get; set; }      public clientlogentries()     {         entries = new list<clientlogentry>();     } } 

where clientlogentry has properties inside logentry node.

var serializer = new xmlserializer(typeof(logentries)); var entries= (logentries)serializer.deserialize(this.taskdefinition.xmlstream); 

it says <root xmlns=''> not expected. idea change?


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -