2

Does anybody know how to solve the problem caused by a complex element and its child with the same name?

Env: Ubuntu, Java 10, maven-jaxb2-plugin:0.13.3

XSD:

<xs:element name="TheSameName">
    <xs:complexType>
        <xs:sequence minOccurs="1" maxOccurs="unbounded">
            <xs:element name="TheSameName">
                <xs:complexType>
                    <xs:sequence>
                        <xs:any processContents="skip" minOccurs="1" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
</xs:element>

BIND.XML

<jxb:bindings node="/xs:schema/xs:element[@name='TheSameName']">
  <jxb:class name="TheSameNameList"/>
</jxb:bindings>

ERROR:

Complex type and its child element share the same name "TheSameName". Use a class customization to resolve this conflict.

With Java 8 was OK but with Java 10 no more :-( Any idea?

BR, Wianki

Wianki
  • 21
  • 4
  • Possible duplicate of [JAXB and complexType sharing name with one of it's elements generates incorrect code](https://stackoverflow.com/questions/12297940/jaxb-and-complextype-sharing-name-with-one-of-its-elements-generates-incorrect) – Naman May 13 '18 at 15:36
  • 1
    nullpointer : in my question the parent-name = child-name (Java8: OK; Java10: NOT) – Wianki May 13 '18 at 17:34
  • Try to customize `/xs:schema/xs:element[@name='TheSameName']/xs:complexType` and/or `/xs:schema/xs:element[@name='TheSameName']/xs:complexType/xs:sequence/xs:element[@name='TheSameName']/xs:complexType`. – lexicore May 13 '18 at 17:59
  • I have already tried that ant with jaxws in jaxb too: true false In any case I get the message: "Complex type and its child element share the same name "TheSameName". Use a class customization to resolve this conflict – Wianki May 13 '18 at 18:52

0 Answers0