XSD - proper way to express group of elements...

Discussion in 'XML' started by unishippers.suckfeed.newshosting.com, Nov 3, 2004.

  1. Hi,
    I am wondering what is the best way to express a group of sub-elements not
    required to be in any order?
    so...

    <person>
    <height/>
    <weight/>
    </person>

    or

    <person>
    <weight/>
    <height/>
    </person>

    ....are both valid when validated by the XSD Schema file.

    Thanks ahead of time,

    Jason
     
    unishippers.suckfeed.newshosting.com, Nov 3, 2004
    #1
    1. Advertising

  2. Hi Jason,

    You can use the xs:all element, as long as each of the children can
    appear no more than one time.

    For example:

    <xs:complexType name="PersonType">
    <xs:all>
    <xs:element name="height"/>
    <xs:element name="weight"/>
    </xs:all>
    </xs:complexType>

    Hope that helps,
    Priscilla
    -----------------------------------------------------
    Priscilla Walmsley
    Author, Definitive XML Schema (Prentice Hall PTR)
    http://www.datypic.com
    -----------------------------------------------------

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Priscilla Walmsley, Nov 4, 2004
    #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. Chen Xiyang
    Replies:
    2
    Views:
    3,923
    =?Utf-8?B?Q2hyaXMgUG9kbW9yZQ==?=
    Mar 1, 2005
  2. ad
    Replies:
    7
    Views:
    703
    Scott Allen
    Apr 11, 2005
  3. beethoven_forever
    Replies:
    0
    Views:
    368
    beethoven_forever
    Jul 15, 2005
  4. cayblood
    Replies:
    14
    Views:
    571
    Neil Cerutti
    Nov 4, 2005
  5. Mike MacCana
    Replies:
    4
    Views:
    273
    Sebastian \lunar\ Wiesner
    Jul 23, 2008
Loading...

Share This Page