XML Schema choice and axis

Discussion in 'XML' started by DayCoder, Aug 6, 2007.

  1. DayCoder

    DayCoder Guest

    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.
     
    DayCoder, Aug 6, 2007
    #1
    1. Advertisements

  2. Hi,

    DayCoder <> writes:

    > 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

    --
    Boris Kolpackov
    Code Synthesis Tools CC
    http://www.codesynthesis.com
    Open-Source, Cross-Platform C++ XML Data Binding
     
    Boris Kolpackov, Aug 7, 2007
    #2
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,300
  2. Markus
    Replies:
    1
    Views:
    1,924
    Markus
    Nov 23, 2005
  3. GB
    Replies:
    0
    Views:
    605
  4. Fred Smith
    Replies:
    1
    Views:
    1,196
    Martin Honnen
    Feb 5, 2004
  5. Hari Om
    Replies:
    1
    Views:
    588
    Martin SChukrazy
    Mar 2, 2004
  6. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,566
    Stanimir Stamenkov
    Apr 25, 2005
  7. Replies:
    3
    Views:
    4,557
  8. Replies:
    5
    Views:
    1,677
    Brian McCauley
    Nov 29, 2006
Loading...