I'm currently trying to deserialize the following:
XSD:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Inventory"
targetNamespace="http://tempuri.org/Inventory.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/Inventory.xsd"
xmlns:mstns="http://tempuri.org/Inventory.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
><xs:element name="Inventory">
<xs:complexType>
<xs:sequence>
<xs:element name="Slot" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="SStat" minOccurs="0"
maxOccurs="unbounded" nillable="1">
<xs:complexType>
<xs:attribute name="SType"
type="xs:short" use="required"/>
<xs:attribute name="SEffect"
type="xs:short" use="required"/>
<xs:attribute name="SValue"
type="xs:short" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="IID" type="xs:int"
use="required"/>
<xs:attribute name="Amount" type="xs:short"
use="required"/>
<xs:attribute name="Number" type="xs:short"
use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
XML:
<?xml version="1.0" encoding="utf-16"?>
<Inventory>
<Slot IID="1" Amount="1" Number="22">
<SStat SType="0" SEffect="1" SValue="5" />
<SStat SType="1" SEffect="1" SValue="1" />
</Slot>
</Inventory>
The deserialization works fine, and reads in the inventory and slot
object, but fails to load the SStat objects and instead put in a null
array.
Anyone?
*** Sent via Developersdex http://www.developersdex.com ***