Hi there.
It seems to work for me in EA (apart from the extra root element EA puts in when you generate the XSD back out - which you just delete).
Which version of EA are you using? (I am using the latest - 6.5.798)
I don't know why your EA collapses into only one complex type.
1. I imported your XSD (your original version at the top). I got the 2 distinct complex types generated in EA
2. I then generated the following XSD out of EA.
<?xml version="1.0"?>
<xs:schema targetNamespace="
http://www.testStuff.com/Handler" xmlns:ce="
http://www.testStuff.com/CanonicalEvents" xmlns:hnd="
http://www.testStuff.com/InHand" xmlns:xs="
http://www.w3.org/2001/XMLSchema">
<xs:import namespace="
http://www.testStuff.com/CanonicalEvents"/>
<xs:element name="ArrayofEvents" type="ArrayofEvents"/>
<xs:complexType name="ArrayofEvents">
<xs:choice>
<xs:element name="BalanceEvent" type="ce:BalanceEvent"/>
<xs:element name="CloseEvent" type="ce:CloseEvent"/>
<xs:element name="OpenEvent" type="ce:OpenEvent"/>
<xs:element name="ReturnEvent" type="ce:ReturnEvent"/>
<xs:element name="TimeoutEvent" type="ce:TimeoutEvent"/>
<xs:element name="VoidEvent" type="ce:VoidEvent"/>
<xs:element name="WarningEvent" type="ce:WarningEvent"/>
</xs:choice>
</xs:complexType>
<xs:element name="InHand"/>
<xs:element name="InHand" type="InHand"/>
<xs:complexType name="InHand">
<xs:sequence>
<xs:element name="inHandDateTime" type="xs:dateTime"/>
<xs:element name="inHandEvents" type="hnd:ArrayofEvents" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="inHandId" type="xs:unsignedLong"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
Have I missed something?
Cheers,
David.