W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2006

Re: optional, but at least one required

From: Brian Bonner <bkbonner@gmail.com>
Date: Thu, 5 Jan 2006 12:47:10 -0500
Message-ID: <e0904ff40601050947y57963b16od21589183a4d87ea@mail.gmail.com>
To: xmlschema-dev@w3.org

George, Michael,  thanks.

I'm sorry I wasn't complete.  Yes, multiple occurrences of a, b and c
are allowed.  That's a critical piece I left out.


So, someone could create:

<options>
     <a/>
</options>

<options>
     <a/>
     <b/>
</options>

<options>
      <b/>
</options>

<options>
      <a/>
      <b/>
      <c/>
</options>

and several others,

but not:

<options/>

So each of them are optional, but *at least* one of them must be
specified and multiple can be specified at once.

I think George's model which imposes ordering on the elements might do
the trick.  I'll give that a shot.

Thank you.

Brian




On 1/5/06, Michael Kay <mike@saxonica.com> wrote:
>
> You need to specify the requirements in a little more detail:
>
> * are multiple occurrences of a, b, and c allowed?
>
> * what constraints do you want to impose on the ordering of the elements?
>
> Michael Kay
> http://www.saxonica.com/
>
>
> > -----Original Message-----
> > From: xmlschema-dev-request@w3.org
> > [mailto:xmlschema-dev-request@w3.org] On Behalf Of Brian Bonner
> > Sent: 04 January 2006 19:22
> > To: xmlschema-dev@w3.org
> > Subject: optional, but at least one required
> >
> >
> > Hello,
> >
> > Is there a way through restrictions or xmlschema in general to create
> > the following criteria?
> >
> > <options>
> >      <a></a>
> >      <b></b>
> >      <c></c>
> > </options>
> >
> > where the rule is that a, b and c are all optional, but at least one
> > of a, b or c is required.
> >
> > Thanks.
> >
> > Brian
> >
> >
> >
>
>
>
>
Received on Thursday, 5 January 2006 17:47:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:52 GMT