You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Martin Deutsch (Jira)" <ji...@apache.org> on 2019/11/26 09:31:00 UTC

[jira] [Created] (CXFXJC-37) Generated code is not compilable using super-types and super-elements are used in the xsd

Martin Deutsch created CXFXJC-37:
------------------------------------

             Summary: 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


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}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)