Using xml: JAXB2.0 -XJC compiliation Issue on newest questions tagged xml – Stack Overflow

I am using JAXB 2.0 to generate POJO .
I have the following XSD

<?xml version="1.0" encoding="UTF-8"?>
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="test">
      <xs:complexType>
        <xs:attribute name="system" type="xs:string"/>
        <xs:attribute name="dim" type="xs:integer"/>
      </xs:complexType>
    </xs:element>
    <xs:element name="test1" type="xs:string"/>
    <xs:element name="test2" type="xs:string"/>
    <xs:element name="scoring_guide" type="embedded_scoring_guide_type"/>
    <xs:complexType name="embedded_scoring_guide_type">
      <xs:sequence>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element ref="test"/>
          <xs:element ref="test1"/>
        </xs:choice>
        <xs:choice>
          <xs:element ref="test2" maxOccurs="unbounded"/>
        </xs:choice>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element ref="test"/>
          <xs:element ref="test1"/>
        </xs:choice>
      </xs:sequence>
    </xs:complexType>
</xs:schema>

When I am trying to generate POJO out of the above Schema .I am getting the below error:

Gennerating jaxb objects for C:\WORKAREA\JAXB\SubSeqenceElementCall\schema\SubSequentElementCall.xsd Using XJC generator...
parsing a schema...

[ERROR] Property "TestOrTest1" is already defined. Use &lt;jaxb:property> to resolve this conflict.
  line 14 of file:/C:/WORKAREA/JAXB/SubSeqenceElementCall/schema/SubSequentElementCall.xsd

[ERROR] The following location is relevant to the above error
  line 21 of file:/C:/WORKAREA/JAXB/SubSeqenceElementCall/schema/SubSequentElementCall.xsd

[ERROR] Element "test1" shows up in more than one properties.
  line 21 of file:/C:/WORKAREA/JAXB/SubSeqenceElementCall/schema/SubSequentElementCall.xsd

[ERROR] The following location is relevant to the above error
  line 14 of file:/C:/WORKAREA/JAXB/SubSeqenceElementCall/schema/SubSequentElementCall.xsd

Failed to parse a schema.
Gennerating jaxb objects for C:\WORKAREA\JAXB\SubSeqenceElementCall\schema\SubSequentElementCall.xsd Completed!

Please help on the above issue.

Thanks
Vikram

See Answers


source: http://stackoverflow.com/questions/8792816/jaxb2-0-xjc-compiliation-issue
Using xml: using-xml



online applications demo