[jboss-jira] [JBoss JIRA] Updated: (JBXB-104) Improper marshalling for sequence of choices

Wojciech Kudla (JIRA) jira-events at lists.jboss.org
Sun Jul 8 09:19:51 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBXB-104?page=all ]

Wojciech Kudla updated JBXB-104:
--------------------------------

    Description: 
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.

  was:
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.

This bug exists also in the trunk revision of JBoss XML Binding.


> 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
>
> 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

        



More information about the jboss-jira mailing list