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

Re: Extending "choice" model group in a xsd schema

From: Jaikiran <jai_forums2005@yahoo.co.in>
Date: Wed, 13 Jan 2010 01:17:59 -0800 (PST)
Message-ID: <27141748.post@talk.nabble.com>
To: xmlschema-dev@w3.org


Kevin Braun wrote:
> 
> On 12/28/2009 9:28 AM, Jaikiran Pai wrote:
>> (red | blue)* (dark-red | dark-blue)*
> 
> What you actually have is:
>   (red | blue)+ (dark-red | dark-blue)+
> 
> Your choice groups don't have minOccurs=0. 
> 
Hmm, i apparently misunderstood the cardinality of "choice". I was referring
to this article
http://www.oracle.com/technology/pub/articles/srivastava_structures.html
which says:

" Choice - (a | b)* - means that from the set of child elements declared
within the choice model group exactly one element must occur in the
corresponding XML-instance. The cardinality of a choice model group can
range from 0 to unbounded. A choice model group can futher contain a
sequence or a choice model group recursively." 

It's the (a | b) * which misled me.



Kevin Braun wrote:
> 
> If you are after (red | blue | dark-red | dark-blue)+, you aren't going 
> to achieve it the way you are going.  Walmsley suggests using 
> substitution groups to extend choice groups (see 19.5.2 Extensions for 
> Choice Groups, in Definitive XML Schema).  You might take a look at that 
> approach and see if it meets your needs.
> 
Thanks Kevin, looking forward to get a copy of that one.

-- 
View this message in context: http://old.nabble.com/Extending-%22choice%22-model-group-in-a-xsd-schema-tp26967149p27141748.html
Sent from the w3.org - xmlschema-dev mailing list archive at Nabble.com.
Received on Wednesday, 13 January 2010 09:18:28 GMT

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