Hi
I am trying to use XMLSerialzer class to generate serializable class for
following schema.
<xs:element name="KeyIdentifiers" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="KeyIdentifier" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="KeyIdentifierField" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" form="unqualified"
type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" form="unqualified"
type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
After generating class using xsd.exe I see following code in generated class
class GObject
{
.....
.....
public GObjectEntityKeyIdentifiersKeyIdentifier[][] KeyIdentifiers;
.....
......
}
Now when I try to create XMLSerialzer object function fails.
XmlSerializer xs = new XmlSerializer(typeof(GLibrary.GObject));
When I checked intermediate .cs file generated bu XMLSerializer then I found
following line due to which compilation fails resulting in failure of
XMLSerialzer creation.
Write13_GObjectEntityKeyIdentifiersKeyIdentifier(@ "KeyIdentifier",
@"http://Genie.org/Entity.xsd",
((GLibrary.GObjectEntityKeyIdentifiersKeyIdentifie r)a[ia]), false, false);
It seems source generation of XMLSerializer does not handle two dimensional
arrays correctly because when I remove maxOccurs="unbounded" from
KeyIdentifiers element then everything works fine becuase then it is only
single dimension array.
Regards