xs choice,xs group,minoccurs maxoccurs,xs choice maxoccurs unbounded,xs choice minoccurs maxoccurs,group xs,re xs,xs choice example,choice minoccurs maxoccurs,choice minoccurs, xml%%%xs choice - Re: xs:group/xs:choice[@minOccurs

[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xs:group/xs:choice[@minOccurs | @maxOccurs]


xs choice
Bob Foster <bob@o...> writes:

> I'm a bit puzzled by this. I can see why he can't have a
> minOccurs/maxOccurs on the group item as specified but why not on the
> choice nested in the group. This looks legal to me and I am curious
> what processors do not accept it.

On balance the reasoning the XML Schema WG went with was roughly this:

 1) Named model groups will be most useful if different references to
    them can have different min/max values;
 2) Allowing min/max on both references _and_ on the top level group
    in the named group definition, e.g.

       . . .
       <xs:group ref="myGroup" minOccurs="1" maxOccurs="10"/>
       . . .

    <xs:group name="myGroup">
     <xs:choice minOccurs="2" maxOccurs="4">
       . . .
     </xs:choice>
    </xs:group>

    would be _very_ confusing and difficult to explain;
 3) So we rule out min/max on the top group in a named model group defn.

Note also that

     <xs:choice minOccurs="0" maxOccurs="unbounded">
       <xs:element name="e1"/>
       <xs:element name="e2"/>
       <xs:element name="e3"/>
     </xs:choice>
 
means something _quite_ different from

     <xs:choice>
       <xs:element name="e1" minOccurs="0" maxOccurs="unbounded"/>
       <xs:element name="e2" minOccurs="0" maxOccurs="unbounded"/>
       <xs:element name="e3" minOccurs="0" maxOccurs="unbounded"/>
     </xs:choice>

For example, the first allows e1 e2 e1

The second does not.

ht
-- 
 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@i...
                   URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.