XML Schema problem...Thanks

Discussion in 'Java' started by Mavis, Jun 6, 2006.

  1. Mavis

    Mavis Guest

    If I want to assign different value to different versions as the
    followings:

    <versions>
    <version>
    <name> a20 </name>
    <value> 10 </value>
    </version>

    <version>
    <name> b40 </name>
    <value> 50 </value>
    </version>

    <version>
    <name> others</name>
    <value> 5 </value>
    </version>
    </versions>

    I guess it cannot be simplified as below, even if we can use <xs:choice
    maxOccurs="unbounded"> to define elements in any order with any
    occurrences.. the problem is we cannot identify corresponding value for
    each version...

    <versions>
    <version> a20 </version>
    <value> 10 </value>

    <version> b40 </version>
    <value> 50 <value>

    <version> others </version>
    <value> 5 </value>
    </versions>

    Am I right? Could anyone confirm me about this if possible?
    Thanks a lot!
     
    Mavis, Jun 6, 2006
    #1
    1. Advertising

  2. Mavis

    jmcgill Guest

    Mavis wrote:
    > I guess it cannot be simplified as below, even if we can use <xs:choice
    > maxOccurs="unbounded"> to define elements in any order with any
    > occurrences.. the problem is we cannot identify corresponding value for
    > each version...
    >
    > <versions>
    > <version> a20 </version>
    > <value> 10 </value>
    >
    > <version> b40 </version>
    > <value> 50 <value>
    >
    > <version> others </version>
    > <value> 5 </value>
    > </versions>
    >
    > Am I right? Could anyone confirm me about this if possible?
    > Thanks a lot!
    >


    It is only because of the way you read it that this is distinct from:


    <versions>
    <value> 50 <value>
    <value> 10 </value>>
    <value> 5 </value>
    <version> a20 </version>>
    <version> b40 </version>
    <version> others </version>
    </versions>


    Although you may be able indicate the ordering of each element as a
    sequence.

    I liked your first version much, much better.
     
    jmcgill, Jun 6, 2006
    #2
    1. Advertising

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. Markus
    Replies:
    1
    Views:
    1,541
    Markus
    Nov 23, 2005
  2. Fred Smith
    Replies:
    1
    Views:
    949
    Martin Honnen
    Feb 5, 2004
  3. Hari Om
    Replies:
    1
    Views:
    463
    Martin SChukrazy
    Mar 2, 2004
  4. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,265
    Stanimir Stamenkov
    Apr 25, 2005
  5. Replies:
    3
    Views:
    2,874
Loading...

Share This Page