W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2007

RE: optional, but at least one required

From: Michael Kay <mike@saxonica.com>
Date: Wed, 10 Oct 2007 14:17:28 +0100
To: "'George Cristian Bina'" <george@oxygenxml.com>, <vwiswell@verizon.net>
Cc: <xmlschema-dev@w3.org>
Message-ID: <005a01c80b3f$e97b0d60$4063a8c0@turtle>

George, your reading of the requirement is very literal.

"I have a and b, at least one of them has to appear once AND ONLY ONCE." 

My guess at the likely meaning is to accept a|b|ab. But I might be wrong.

Michael Kay 
http://www.saxonica.com/

> -----Original Message-----
> From: xmlschema-dev-request@w3.org 
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of George 
> Cristian Bina
> Sent: 10 October 2007 08:42
> To: vwiswell@verizon.net
> Cc: xmlschema-dev@w3.org
> Subject: Re: optional, but at least one required
> 
> 
> Hi Virginia,
> 
> I understand that what you want is
> ab* | a*b
> and you need to write that in a non ambiguous way to be able 
> to write it in XML Schema.
> 
> So what we need to accept is
> 
> a ab abb abbb ...
> b ab aab aaab ...
> 
> 
> You can write that as
> 
> ((a, (b* | (a+, b))) | b)
> 
> Best Regards,
> George
> ---------------------------------------------------------------------
> George Cristian Bina - http://aboutxml.blogspot.com/ 
> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger 
> http://www.oxygenxml.com
> 
> 
> Virginia Wiswell wrote:
> > I have a similar situation that I'm having trouble with. I 
> have a and 
> > b, at least one of them has to appear once AND ONLY ONCE. a 
> must come before b.
> > The examples in this thread allow more than one occurrence 
> of a or b.
> > 
> > This is my first attempt at customizing a schema and I'm stuck.
> > 
> > TIA, Virginia
> > 
> >> 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/
> > 
> > 
> > 
> > 
> 
Received on Wednesday, 10 October 2007 13:17:44 GMT

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