所以我有这个类生成与xsd.exe,当我反序列化到我的对象的XML它不读取所有的属性。看起来像树中的最后一个属性没有被读取。XML的一些标签没有被反序列化
这是对象的类之一:
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(IsNullable=true)]
public partial class relation : myXml {
/// <remarks/>
public object a;
/// <remarks/>
public object b;
/// <remarks/>
public object c;
/// <remarks/>
public object d;
/// <remarks/>
public object f;
/// <remarks/>
public object g;
/// <remarks/>
public object h;
/// <remarks/>
public object i;
/// <remarks/>
public object j;
}
示例XML:
<z id="Fo">
<attributes>
<Relation>1<Relation>
<YVersion>16<YVersion>
<W>
<a>1</a>
<b>2</b>
<c>3</c>
<d>4</d>
</W>
</attributes>
</z>
当我调试,我与所有反序列化的XML对象,直到节点VV,包括节点VV的所有节点并且它是参数,但是下面的节点不是以某种方式反序列化的,在这种情况下节点A,B,C和D.
Regards,
Hugo
我建议你谷歌“XML到模型C#”你会发现比XSD更好的创造者。他们在线。 – r1verside