Hello,
I have a XSD containing this piece of schema:
<xsd:choice>
<xsd:sequence>
<xsd:element ref="A" />
<xsd:element ref="X" minOccurs="0" maxOccurs="1" />
<xsd:element ref="Y" minOccurs="0" maxOccurs="1" />
</xsd:sequence>
<xsd:choice minOccurs="1" maxOccurs="4">
<xsd:element ref="B" minOccurs="0" maxOccurs="1" />
<xsd:element ref="C" minOccurs="0" maxOccurs="1" />
<xsd:element ref="X" minOccurs="0" maxOccurs="1" />
<xsd:element ref="Y" minOccurs="0" maxOccurs="3" />
</xsd:choice>
</xsd:choice>
When compiling this with JAXB2, I get an error saying:
[ERROR] Element "{schema}X" shows up in more than one properties.
I see that X shows up more than once but I don't understand why it is an
issue. Even weirder, it use to work with JAXB1. I read this post where
someone has basically the same problem :
http://www.nabble.com/jaxb2---duplicate-element--issue-td16429810.html
The anwser suggests that _consecutive_ elements with the same name should be
in the same sequence. In my case the elements are not consecutive, they are
in alternative choices.
Anyway I could maybe change the schema to put the element in the same
sequence but I have two issue with that. First of all the schema is
published by a standard institution so I would prefer to use the unmodified
schema to ensure I comply with the standard. Also I am not sure how to
refactor this piece of schema as a sequence without loosening the order
constraints etc...
Can someone confirm that I have to alter the schema to have it work with
JAXB2 (maybe I just don't use xjc properly)? If so any pointer to a tutorial
on XSD "arithmetic" that I can use to transform the schema properly?
Thanks in advance,
Thomas Leplus
--
View this message in context: http://www.nabble.com/Element-shows-up-in-more-than-one-properties-tp19573251p19573251.html
Sent from the java.net - jaxb dev mailing list archive at Nabble.com.