[
http://jira.jboss.com/jira/browse/JBXB-104?page=all ]
Alexey Loubyansky closed JBXB-104.
----------------------------------
Resolution: Rejected
Assignee: Alexey Loubyansky
The sequence element defines a sequence of particles that can appear in the content. In
your case, it's only one choice. Since the choice is not repeatable and the sequence
is not repeatable, the result you posted is expected. But actually throwing an exception
would probably be the right thing to do if there were more values to marshal.
Improper marshalling for sequence of choices
--------------------------------------------
Key: JBXB-104
URL:
http://jira.jboss.com/jira/browse/JBXB-104
Project: JBoss XML Binding (JBossXB)
Issue Type: Bug
Environment: JBoss 4.2.0 with bundled jboss-xml-binding.jar on Windows XP, SUSE
with 1dk 1.5.11
Reporter: Wojciech Kudla
Assigned To: Alexey Loubyansky
When XML Schema includes <choice> nested in <sequence> element,
MarshallerImpl serializes only the first element, ie.
<xs:complexType name="testType">
<xs:sequence>
<xs:choice>
<element name="el1" type="xs:string" minOccurs="0"
nillable="true" />
<element name="el2" type="xs:string" minOccurs="0"
nillable="true" />
<element name="el3" type="xs:string" minOccurs="0"
nillable="true" />
<xs:choice>
</xs:sequence>
</xs:complexType>
For this schema definition, the serialized output for object containing all 3 elements
would be only:
<elementOfTypeTestType>
<el1>test</el1>
</elementOfTypeTestType>.
In my opinion it is not proper handling of the mentioned type. The reason for this
behavior lies in method responsible for marshaling elements nested in choice group. It
returns after properly marshaling the first element. Instead it should first check the
choice element's parent and return only if the parent is not sequence element.
This bug exists also in the trunk revision of JBoss XML Binding.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira