jaxb2-basics
jaxb2-basics copied to clipboard
Simplifying element (rather than type) results in 'Unable to honor this as-element-property customization. It is attached to a wrong place, or its inconsistent with other bindings.'.
` <xsd:schema xmlns="http://www.example.com/schema-a" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:schema-b="http://www.example.com/schema-b" targetNamespace="http://www.example.com/schema-a" elementFormDefault="qualified">
<xsd:import schemaLocation="schema-b.xsd" namespace="http://www.example.com/schema-b"/>
<xsd:complexType name="exampleType">
<xsd:sequence>
<xsd:element name="property-a" type="xsd:positiveInteger" minOccurs="0"/>
<xsd:element ref="schema-b:example-element" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema> `
` <xsd:schema xmlns="http://www.example.com/schema-b" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.com/schema-b" elementFormDefault="qualified">
<xsd:element name="example-element" >
<xsd:complexType>
<xsd:sequence>
<xsd:choice>
<xsd:sequence>
<xsd:element name="element-a" type="xsd:string"/>
<xsd:element name="element-b" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:element name="element-b" type="xsd:string"/>
</xsd:choice>
<xsd:element name="blah" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema> `
How to simplify the choice in example-element. Adding binding or directly in the schema results in the error from the title.
Need to check but seems to be duplicate of https://github.com/highsource/jaxb2-basics/issues/133