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
Post a Comment