[
https://issues.apache.org/jira/browse/CXFXJC-37?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martin Deutsch updated CXFXJC-37:
---------------------------------
Description:
If super-types and super-elements are used in the xsd, the code does not
compile due to the default constructor of the JAXBElement is generated. The
JAXBElement has no default constructor.
Add this to your {{foo.xsd}} in the {{cxf-xjc-dv-test}} module so you will get
the disired result:
{code:xml}
<xs:element name="fooSuperelement" type="tns:fooSupertype" />
<xs:complexType name="fooSupertype" abstract="true" />
<xs:element name="fooWithSubstitutionGroup" type="tns:fooWithReference"
substitutionGroup="tns:fooSuperelement" />
<xs:complexType name="fooWithReference">
<xs:complexContent>
<xs:extension base="tns:fooSupertype">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1"
ref="tns:fooSuperelement" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
{code}
was:
If super-types and super-elements are used in the xsd, the code does not
compile due to the default constructor of the JAXBElement is generated. The
JAXBElement has no default constructor.
Add this to your {{foo.xsd}} in the {{cxf-xjc-dv-test}} module so you will get
the disired result:
{code:xml}
{code:java}
<xs:element name="fooSuperelement" type="tns:fooSupertype" />
<xs:complexType name="fooSupertype" abstract="true" />
<xs:element name="fooWithSubstitutionGroup" type="tns:fooWithReference"
substitutionGroup="tns:fooSuperelement" />
<xs:complexType name="fooWithReference">
<xs:complexContent>
<xs:extension base="tns:fooSupertype">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1"
ref="tns:fooSuperelement" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType> {code}
> Generated code is not compilable using super-types and super-elements are
> used in the xsd
> -----------------------------------------------------------------------------------------
>
> Key: CXFXJC-37
> URL: https://issues.apache.org/jira/browse/CXFXJC-37
> Project: CXF XJC Utils
> Issue Type: Bug
> Components: DV Plugin
> Affects Versions: 3.3.0
> Reporter: Martin Deutsch
> Priority: Major
>
> If super-types and super-elements are used in the xsd, the code does not
> compile due to the default constructor of the JAXBElement is generated. The
> JAXBElement has no default constructor.
> Add this to your {{foo.xsd}} in the {{cxf-xjc-dv-test}} module so you will
> get the disired result:
> {code:xml}
> <xs:element name="fooSuperelement" type="tns:fooSupertype" />
> <xs:complexType name="fooSupertype" abstract="true" />
>
> <xs:element name="fooWithSubstitutionGroup" type="tns:fooWithReference"
> substitutionGroup="tns:fooSuperelement" />
>
> <xs:complexType name="fooWithReference">
> <xs:complexContent>
> <xs:extension base="tns:fooSupertype">
> <xs:sequence>
> <xs:element minOccurs="1" maxOccurs="1"
> ref="tns:fooSuperelement" />
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)