There are errors in the xsd.exe tool. I donβt remember this particular one, but I remember that I find problems with gear arrays, and this is possible, this is a mistake. if you want, you can use the XsdObjbectGen tool, also from Microsoft, but released independently and out of range of .NET. SDK
One thing you can do is go backwards: write C # code, and then generate the circuit using xsd.exe and see what is different. Perhaps xsd.exe wants the circuit to look a certain way in order to correctly generate the correct code for the jagged arrays.
Actually, when re-reading your question, you never said what you really wanted. Do you want SuccessType to contain an array of arrays or not?
And is it WarningsType or WarningType ? There are some differences between the codes you provided.
Assuming you need an array of arrays, I wrote this C # code:
public class WarningType { public String oof; } public partial class SuccessType { private WarningType[][] warningsField; /// <remarks/> [System.Xml.Serialization.XmlArrayItemAttribute("Warning", typeof(WarningType[]), IsNullable = false)] public WarningType[][] Warnings { get { return this.warningsField; } set { this.warningsField = value; } } }
... then compiled it into a DLL. Then I ran xsd.exe in this DLL and generated this XSD:
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="WarningType" nillable="true" type="WarningType" /> <xs:complexType name="WarningType"> <xs:sequence> <xs:element minOccurs="0" maxOccurs="1" name="oof" type="xs:string" /> </xs:sequence> </xs:complexType> <xs:element name="SuccessType" nillable="true" type="SuccessType" /> <xs:complexType name="SuccessType"> <xs:sequence> <xs:element minOccurs="0" maxOccurs="1" name="Warnings" type="ArrayOfArrayOfWarningType" /> </xs:sequence> </xs:complexType> <xs:complexType name="ArrayOfArrayOfWarningType"> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" name="Warning" type="ArrayOfWarningType" /> </xs:sequence> </xs:complexType> <xs:complexType name="ArrayOfWarningType"> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" name="WarningType" nillable="true" type="WarningType" /> </xs:sequence> </xs:complexType> </xs:schema>
... and these are circular trips. If I run xsd.exe in this circuit, I get a type that wraps an array of arrays.
Cheeso
source share