W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2004

Re: Unique Particle Attribution

From: Henry S. Thompson <ht@inf.ed.ac.uk>
Date: Wed, 05 May 2004 16:28:46 +0100
To: Veerappan Saravanan-ESV007 <esv007@motorola.com>
Cc: "'noah_mendelsohn@us.ibm.com'" <noah_mendelsohn@us.ibm.com>, xmlschema-dev@w3.org
Message-ID: <f5b3c6evqoh.fsf@erasmus.inf.ed.ac.uk>

Not sure what you actually want.

If what you wrote is really what you mean, which I _think_ is that all
and only the following are allowed

   aaaaab
   aaaab
   aaab
   aab
   ab
   abb
   abbb
   abbbb
   abbbbb
   
then all you need is

  <xs:sequence>
   <xs:element ref="a"/>
   <xs:choice>
    <xs:element ref="b" maxOccurs="5"/>
    <xs:sequence>
     <xs:element ref="a" maxOccurs="4"/>
     <xs:element ref="b"/>
    </xs:sequence>
   </xs:choice>
  </xs:sequence>

If only

 abbbbb
 ab
 aaaaab

are allowed, that can be done as

 <xs:sequence>
   <xs:element ref="a"/>
   <xs:choice>
    <xs:sequence>
     <xs:element ref="b"/>
     <xs:sequence minOccurs="0">
      <xs:element ref="b" maxOccurs="4" minOccurs="4"/>
     </xs:sequence>
    </xs:sequence>
    <xs:sequence>
     <xs:element ref="a" maxOccurs="4" minOccurs="4"/>
     <xs:element ref="b"/>
    </xs:sequence>
   </xs:choice>
  </xs:sequence>

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@inf.ed.ac.uk
                   URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Wednesday, 5 May 2004 11:29:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:43 GMT