Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to override default name in JAXB using external binding?
    primarykey
    data
    text
    <p>I am trying to use JAXB to convert xsd schema to java classes. Unfortunately I do have an issue. The xsd which casues problem is: <code></p> <pre><code>&lt;xs:complexType name="AdditionalDataType"&gt; &lt;xs:sequence&gt; &lt;xs:element name="AvailabilityStatus" minOccurs="0"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element name="AvailabilityStatus" maxOccurs="999"&gt; &lt;xs:complexType&gt; &lt;xs:attributeGroup ref="IdentifierGrp"/&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; </code></pre> <p></code></p> <p>The error I get is <code></p> <pre><code>[ERROR] \target\generated-sources\AdditionalDataType.java:[1012,22] AdditionalDataType.AvailabilityStatus is already defined in AdditionalDataType </code></pre> <p></code> I found this <a href="https://stackoverflow.com/questions/6957568/how-to-override-the-default-name-for-in-jaxb-using-a-external-binding-file">How to override the default name for in JAXB using a external binding file?</a> but when I tried to solve it with the following bindings: <code></p> <pre><code>&lt;jxb:bindings node="//xs:complexType[@name='AdditionalDataType']//xs:sequence//xs:element[@name='AvailabilityStatus']//xs:complexType//xs:sequence//xs:element[@name='AvailabilityStatus']"&gt; &lt;jxb:property name="AvailabilityStatusSA"/&gt; &lt;/jxb:bindings&gt; </code></pre> <p></code></p> <p>it didn't help, it didn't change anything.</p> <p>Can someone please help ?</p> <p>@Ekrem I cannot modify the xml, I would do it but I cannot. I need to have AdditionalDataType which has a List of AvailabilityStatus I dont care if the inner AvailabilityStatus (the one I am trying to map to AvailabilityStatusSA) will be an inner class or not. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload