XML Schema - Must select at least two out of three

Discussion in 'XML' started by Jim Mellish, Feb 15, 2005.

  1. Jim Mellish

    Jim Mellish Guest

    I am trying to put together a schema with some validation on addresses. Three
    of the address fields are Flat, HouseName and HouseNumber. I have to ensure
    that at least two of the three or all three are present. The only way I can
    see to do this is to have a choice between:

    Flat and HouseName
    Flat and HouseNumber
    HouseName and HouseNumber
    Flat and HouseName and HouseNumber

    I guess this is ok for two out of three but what if I had two out of ten ? Is
    there a better way to do this ?

    Jim
    Jim Mellish, Feb 15, 2005
    #1
    1. Advertising

  2. Hi Jim,

    There is no other way to do it in XML Schema

    --
    Stan Kitsis
    Program Manager, XML Technologies
    Microsoft Corporation

    This posting is provided "AS IS" with no warranties, and confers no rights.

    "Jim Mellish" <> wrote in message
    news:4rvQd.2019469$...
    >I am trying to put together a schema with some validation on addresses.
    >Three
    > of the address fields are Flat, HouseName and HouseNumber. I have to
    > ensure
    > that at least two of the three or all three are present. The only way I
    > can
    > see to do this is to have a choice between:
    >
    > Flat and HouseName
    > Flat and HouseNumber
    > HouseName and HouseNumber
    > Flat and HouseName and HouseNumber
    >
    > I guess this is ok for two out of three but what if I had two out of ten ?
    > Is
    > there a better way to do this ?
    >
    > Jim
    >
    Stan Kitsis [MSFT], Feb 18, 2005
    #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,499
    Markus
    Nov 23, 2005
  2. Kenneth Love
    Replies:
    2
    Views:
    797
    Kenneth Love
    Apr 1, 2005
  3. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,173
    Stanimir Stamenkov
    Apr 25, 2005
  4. Replies:
    3
    Views:
    2,801
  5. AAaron123
    Replies:
    0
    Views:
    576
    AAaron123
    Oct 3, 2008
Loading...

Share This Page