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, 12 Jan 2006 17:33:57 -0500
Message-ID: <e0904ff40601121433i4608106aw6d9f7d13190b8025@mail.gmail.com>
To: George Cristian Bina <george@oxygenxml.com>
Cc: xmlschema-dev@w3.org

George, I think you had it right the first time.  (a|b|c)+ allows
multiple copies of a, b or c.

The way you wrote it (and how it needs to be) is:

a, b, or c can each be present, but only 1 copy of each can be
included.  At least one of a, b, or c needs to be present.

I guess I could have used something like

phonenumber
socialsecuritynumber
firstlastname

if these were all uniquely identifying characteristics of a person,
then I could reference it by phone number, social security number, or
first and lastname, or any combination, but I need at least one.

Thanks again for the help.

Brian


On 1/12/06, George Cristian Bina <george@oxygenxml.com> wrote:
> Hi Brian,
>
>  > George, thanks for the tip, I'm assuming that the (a|b|c)+ is the
>  > example that you gave me.
>
> No, that in XML Schema should be:
>
> <xs:complexType>
>      <xs:choice maxOccurs="unbounded">
>          <xs:element ref="a"/>
>          <xs:element ref="b"/>
>          <xs:element ref="c"/>
>      </xs:choice>
> </xs:complexType>
>
> Best Regards,
> George
> ---------------------------------------------------------------------
> George Cristian Bina
> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
> http://www.oxygenxml.com
>
>
> Brian Bonner wrote:
> > George, thanks for the tip, I'm assuming that the (a|b|c)+ is the
> > example that you gave me.  It seemed to do the trick.  I will also try
> > Vegard's idea to see if that solves the problem.  Thanks.
>
>
Received on Thursday, 12 January 2006 22:34:01 GMT

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