Is there maybe an option I should set when loading the xsd?
Here is the schema:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://mynamespace"
targetNamespace="http://mynamespace">
<xsd:element name="Person" type="PersonType"/>
<xsd:complexType name="PersonType">
<xsd:sequence>
<xsd:element name="MyExplicitAnyType" type="xsd:anyType"/>
<xsd:element name="MyImplicitAnyType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="EmployerType">
<xsd:sequence>
<xsd:element name="EmployerName" type="xsd:string"/>
<xsd:element name="EmployerAddress" type="AddressType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="AddressType">
<xsd:sequence>
<xsd:element name="Zip" type="xsd:integer"/>
</xsd:sequence>
<xsd:attribute name="Label" type="xsd:string"/>
</xsd:complexType>
</xsd:schema>
Then with this xml:
<n1:Person xmlns:n1="http://mynamespace"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MyExplicitAnyType xsi:type="n1:EmployerType">
<EmployerName>SomeCompany</EmployerName>
<EmployerAddress Label="work">
<Zip>54321</Zip>
</EmployerAddress>
</MyExplicitAnyType>
<MyImplicitAnyType xsi:type="n1:AddressType" Label="home">
<Zip>12345</Zip>
</MyImplicitAnyType>
</n1:Person>
I get the exception:
Fails to load with: Class 'AddressType' is not found or is abstract
I use the XSDEcoreBuilder to translate the above xsd to an EPackage
in-memory. So maybe I need to specify certain options there?