Hi,
I was wondering what to do with the following issue I am having:
When unmarshalling an XML document into Java Objects everything seems to go
fine, except for some elements which have a quite complex definition in the
XML Schema. The Schema is too large to post, so I will keep it to some
simplified example,
consider the XML Schema definition for an element:
<xs:element name="SomeElement">
<xs:annotation>
<xs:documentation>Some info here.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="ChildTypeA"/>
<xs:choice maxOccurs="unbounded">
<xs:element ref="ChildTypeX" />
<xs:element ref="ChildTypeY" />
</xs:choice>
<xs:element ref="ChildTypeB"/>
<xs:choice maxOccurs="unbounded">
<xs:element ref="ChildTypeX" />
<xs:element ref="ChildTypeY" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
This is equivalent to a DTD definition as follows:
<!ELEMENT SomeElement (A, (X|Y)+, B, (X|Y)+) >
This will make an object called 'SomeElement', having 2 methods called
getSomeElementChoice() and getSomeElementChoice2(), both choices returned by
these methods contain SomeElementChoiceItem or SomeElementChoice2Item
instances.
Now, it appears that all of these items will be returned by the 'first'
choice, the 'second' choice is always empty. Furthermore, this problem does
not occur when the 2 choices have different child element names (as you may
have already noticed, they share ChildTypeX and ChildTypeY)
Am I doing something wrong, or is this unusual behaviour ?
thanx.
Wouter.
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev