- From: Hess Yvan <yvan.hess@imtf.ch>
- Date: Wed, 4 Feb 2004 18:25:12 +0100
- To: 'Bob Schloss' <rschloss@us.ibm.com>
- Cc: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Hi Bob, Thanks four you answer. The usage of choice occurence combined with element seems to be quite complex. Where can I find a good documentation about its usage ? -----Original Message----- From: Bob Schloss [mailto:rschloss@us.ibm.com] Sent: mercredi, 4. février 2004 17:53 To: Hess Yvan Cc: 'xmlschema-dev@w3.org' Subject: Re: Intepretation of choice compositor and occurence into xml schema Hess, The first content model permits <document/> <document><A>..</A></document> <document><B>..</B></document> <document><C>..</C></docuemnt> <document><A>..</A><A>..</A></document> <document><A>..</A><B>..</B></document> <document><A>..</A><C>..</C></document> <document><B>..</B><B>..</B></document> <document><B>..</B><C>..</C></document> <document><B>..</B><A>..</A></document> <document><C>..</C><A>..</A></document> <document><C>..</C><B>..</B></document> <document><C>..</C><C>..</C></document> corresponding to occurs of 0, 1 and 2 for the choice particle. The middle content model permits <document/> where every inner occurs is 0 <document><A>..</A></document> <document><B>..</B></document> <document><C>..</C><document> where the outer occurs is 1 and the inner occurs is 1 <document>any sequence of multiple A,B,C tags whatsoever</document> where the outer occurs is > 1 and the inner occurs is sometimes 0 and sometimes 1 Your last content model permits <document/> where outer occurs was 1 and choice went to element B or element C with occurs of 0 <document><A>,,</A></document> <document><B>..</B></document> <document><B>..</B><B>..</B></document> <document><B>..</B><B>..</B><B>..</B></document> <document><C>..</C></document> where outer occurs was 1 any valid concatentation of the content patterns shown above is permitted, where occurs > 1 Good luck, Bob XML/XSL Transformational Systems - Extensible Technologies IBM Thomas J Watson Research Center Yorktown Heights, New York, USA Hess Yvan <yvan.hess@imtf.c h> To Sent by: "'xmlschema-dev@w3.org'" xmlschema-dev-req <xmlschema-dev@w3.org> uest@w3.org cc Subject 02/04/2004 11:17 Intepretation of choice compositor AM and occurence into xml schema 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
Received on Wednesday, 4 February 2004 12:30:22 UTC