Return-Path: Delivered-To: apmail-xml-general-archive@xml.apache.org Received: (qmail 67093 invoked by uid 500); 9 Aug 2001 10:06:09 -0000 Mailing-List: contact general-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: general@xml.apache.org Delivered-To: mailing list general@xml.apache.org Received: (qmail 67082 invoked from network); 9 Aug 2001 10:06:08 -0000 Message-ID: <011601c120ba$5f48d8a0$0601460a@teamlog.fr> Reply-To: "Baptiste Burgaud" From: "Baptiste Burgaud" To: , References: <3B71A7E7.D8CCE2C0@choicehotels.com> Subject: Re: Schema - conjunction question Date: Thu, 9 Aug 2001 12:02:08 +0200 Organization: Teamlog MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Hi John, > I have a question reqarding the order imposed on elements in a schema. I think you will get more answers on xmlschema-dev@w3.org > The document "XML Schema Part 1: Structures, W3C Recommendation 2 May > 2001" says that a model group may be one of three types as follows: > > "2.2.3.1 Model Group > > A model group is a constraint in the form of a grammar fragment that > applies to lists of element information items. It consists of a list of > particles, i.e. element > declarations, wildcards and model groups. There are three varieties of > model group: > > Sequence (the element information items match the particles in > sequential order); > Conjunction (the element information items match the particles, in > any order); > Disjunction (the element information items match one of the > particles)." > > I think I want a "Conjunction" (instead of a sequence) but I can't seem > to find an appropriate example of how to construct such a conjunction. > Can anyone point me to some material which addresses this variation? > you should use the compositor, as said in the "XML Schema Part 1: Structures" document : "3.8.1 The Model Group Schema Component The model group schema component has the following properties: Schema Component: Model Group {compositor} One of all, choice or sequence. {particles} A list of particles {annotation} Optional. An annotation. specifies a sequential (sequence), disjunctive (choice) or conjunctive (all) interpretation of the {particles}. This in turn determines whether the element information item [children] �validated� by the model group must: (sequence) correspond, in order, to the specified {particles}; (choice) corresponded to exactly one of the specified {particles}; (all) contain all and only exactly zero or one of each element specified in {particles}. The elements can occur in any order. In this case, to reduce implementation complexity, {particles} is restricted to contain local and top-level element declarations only, with {min occurs}=0 or 1, {max occurs}=1. " "Example " > I am trying to define a complexType which may have its elements in any > order with the usual range of constraints on each element. Some elements > may have maxOccurs > 1. this is more complex, as "{particles} is restricted to contain local and top-level element declarations only, with {min occurs}=0 or 1, {max occurs}=1" when using the compositor. what you can do is: this will end with the regular expr you want (where someThing element is "s", anotherThing element is "a" and yetAnotherThing element is "y") : ( sa*y | sya* | a*ys | a*sy | ya*s | ysa* ) where the multiple element is bounded to "whateverOccurYouNeed" Well, I hope someone has a better solution, because this one force to define !n groups... (n is the number of different elements) --------------------------------------------------------------------- In case of troubles, e-mail: webmaster@xml.apache.org To unsubscribe, e-mail: general-unsubscribe@xml.apache.org For additional commands, e-mail: general-help@xml.apache.org