Trouble with XML Deserialization into XSD generated classes

后端 未结 4 1748
无人共我
无人共我 2021-01-02 02:11

I have a rather detailed xml file. Below is the top level nodes (I have included the ellipse as the lower level nodes are all well formed and properly filled with data):

4条回答
  •  醉话见心
    2021-01-02 02:49

    XSD.EXE is a good start - but it's far from perfect. Also, based on the XML you provided, XSD.EXE can't always decide for sure whether something is a single instance of an object, or an open-ended array of objects.

    This seems to be the case for your two elements - Application.Lease and Application.CashFlow. How are they defined in the generated XSD file? Does that make sense to you? Quite possibly, you'd have to add a little hints, such as:

    
    

    for an optional property, that's zero or one occurences only. Things like that are really hard for the xsd.exe tool to figure out based on just a single XML sample file.

    Marc

提交回复
热议问题