c# - XmlSerializer - object to string returning "p2:nill" instead of xsi:nill -
after serialzation, object string
i getting current xml
<obj> ... <field p2:nil="true" xmlns:p2="http://www.w3.org/2001/xmlschema-instance"/> ... </obj>
the field nullable waiting xsi:nill, instead getting p2:nill why?
when building xmlserializer can control namespaces, if don't random(ish) names applied. try seeing if helps
var ns = new xmlserializernamespaces(); ns.add("xsi", "http://www.w3.org/2001/xmlschema-instance"); var ser = new xmlserializer(typeof(anentity)); ser.serialize(console.out, new anentity(), ns);
Comments
Post a Comment