jaxb-xew-plugin
jaxb-xew-plugin copied to clipboard
ObjectFactory compilation error for collection using complexType
Hi,
The following xsd (valid according to Altova XMLSpy software) produced a compilation error on ObjectFactory at the generation. It expects the class Generation.ProductionStockage.AppointCollection.class to be created but nothing exist in Generation.ProductionStockage.
Without xew plugin the generation works fine. Also if there is only one element in appoint_collection.
Plugin used:
- maven-jaxb2-plugin : 0.15.1
- jaxb-xew-plugin : 1.11
- Environment : Java 8 / Maven 3.6.0
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="generation">
<xs:complexType>
<xs:sequence>
<xs:element name="production_stockage_collection">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element name="production_stockage" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:all>
<xs:element name="appoint_collection" minOccurs="0">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="joule_effect" type="xs:string" minOccurs="0"/>
<xs:element name="combustion" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Very likely I won't have time to look into that till August...
Don't worry I can wait until that. Thanks.
It appears 4 methods are created to create elements for appoint_collection :
- createGenerationProductionStockageAppointCollectionJouleEffect
- createGenerationProductionStockageAppointCollectionCombustion
- createGenerationProductionStockageJouleEffect
- createGenerationProductionStockageCombustion
I suppose the problem came from the first two methods that should not be present. The generated code in Generation.java seems correct to me.
Hi dmak, Have you any additional information on that problem?
The methods that didn't compile in ObjectFactory
should have been removed but due to renaming, the information about them was "lost". The issue will be fixed in next release v2.1. Attaching the playground project (XEW-72-scoped.zip).