|
[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
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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








