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

Re: Intepretation of choice compositor and occurence into xml


xml minoccurs 0
The first schema could result in the following possibilities:

(1) No elements (minOccurs="0")
(2) One element - either A, B, or C (minOccurs="1")
(3) Any of the following combinations (minOccurs="2"):
	(a) Element "A" followed by element "A"
	(b) Element "A" followed by element "B"
	(c) Element "A" followed by element "C"
	(d) Element "B" followed by element "A"
	(e) Element "B" followed by element "B"
	(f) Element "B" followed by element "C"
	(g) Element "C" followed by element "A"
	(h) Element "C" followed by element "B"
	(i) Element "C" followed by element "C"

For the second schema, it's more complex - given the "unbounded" facet
value, you would have many more possible combinations, using the same
general technique as I listed above for schema 1. You could potentially
have no elements (due to the minOccurs="0" on each element within the
choice), an infinitely long set of element "A" (same for elements "B"
and "C"), or a set of A/B/A/B/A/C/B/A (just random choices), etc.

Hope this helps.

Kind Regards,
Joe Chiusano
Booz | Allen | Hamilton
Strategy and Technology Consultants to the World

Hess Yvan wrote:
> 
> It is not clear for me how to interpet attribute elements
> minOccurs/maxOccurs into <choice> element having sub-elements that also have
> minOccurs/maxOccurs attributes as for example
> 
> Schema 1:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified" attributeFormDefault="unqualified">
>    <xs:element name="document">
>       <xs:complexType>
>          <xs:choice minOccurs="0" maxOccurs="2">
>             <xs:element name="A" minOccurs="1" maxOccurs="1"/>
>             <xs:element name="B" minOccurs="1" maxOccurs="1" />
>             <xs:element name="C" minOccurs="1" maxOccurs="1"/>
>          </xs:choice>
>       </xs:complexType>
>    </xs:element>
> </xs:schema>
> 
> Schema 2:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified" attributeFormDefault="unqualified">
>    <xs:element name="document">
>       <xs:complexType>
>          <xs:choice minOccurs="1" maxOccurs="unbounded">
>             <xs:element name="A" minOccurs="0" maxOccurs="1"/>
>             <xs:element name="B" minOccurs="0" maxOccurs="1" />
>             <xs:element name="C" minOccurs="0" maxOccurs="1"/>
>          </xs:choice>
>       </xs:complexType>
>    </xs:element>
> </xs:schema>
> 
> Schema 3:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified" attributeFormDefault="unqualified">
>    <xs:element name="document">
>       <xs:complexType>
>          <xs:choice minOccurs="1" maxOccurs="unbounded">
>             <xs:element name="A" minOccurs="1" maxOccurs="1"/>
>             <xs:element name="B" minOccurs="0" maxOccurs="3" />
>             <xs:element name="C" minOccurs="0" maxOccurs="1"/>
>          </xs:choice>
>       </xs:complexType>
>    </xs:element>
> </xs:schema>
> 
> I tried to find more information about this subject on the web, but I didn't
> succeed.
> 
> Can somebody give me more information about how to interpret schema 1,
> schema 2 and schema 3 ?
> 
> Thanks for your help.
> 
> Yvan
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>

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.