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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -