XML Schema choice and axis

D

DayCoder

In my schema file, I have defined a choice as follows:

<xs:complexType name="myChoicesType">
<xs:choice>
<xs:element name="choice1" type="xs:string/>
<xs:element name="choice2" type="xs:string"/>
<xs:element name="choice3" type="xs:string"/>
</xs:choice>
</xs:complexType>

When a client using axis creates an instance document and chooses
choice1, axis is doing the following:

<choice1>blah...blah..blah></choice1>
<choice2 nil="true"/>
<choice3 nil="true"/>

Why is axis including choice2 and choice3 in the instance document
with the nillable attribute set? Is it possible to not have it
include choices that are left out.
 
B

Boris Kolpackov

Hi,

DayCoder said:
In my schema file, I have defined a choice as follows:

<xs:complexType name="myChoicesType">
<xs:choice>
<xs:element name="choice1" type="xs:string/>
<xs:element name="choice2" type="xs:string"/>
<xs:element name="choice3" type="xs:string"/>
</xs:choice>
</xs:complexType>

When a client using axis creates an instance document and chooses
choice1, axis is doing the following:

<choice1>blah...blah..blah></choice1>
<choice2 nil="true"/>
<choice3 nil="true"/>

Seems like a bug in Axis. This XML is not even valid per your
schema. I suggest that you report this to the Axis developers.


-boris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top