Re: Schema Structure Question

Wendy Attenberger <Wendy.Attenberger@nreis.com> writes:

> <Alphabet> 
> <A> 
> <B> 
> <C> 
> </Alphabet> 
> In the schema, how do you indicate that at least one item is required (A,B
> or C), but also allow for some ("A and B" OR "B and C", etc.) items or all
> items(A,B, & C) to be present in the xml? 
> We've messed around with the <xs:choice>, <xs:all> ,minOccurs and maxOccurs,
> but we can't get the right combination? Any ideas? Thanks. 

Funny you should ask -- the XML Schema Working Group is looking at
possible additions to the language for version 1.1 which would
provide for this in a simple way.  As it stands the only way is by
a massive content model, illustrated here for the 3 element case:

  ((a , ((b , c?) | (c , b?))) |
   (b , ((a , c?) | (c , a?))) |
   (c , ((b , a?) | (a , b?))))

Needless to say, this would be pretty large for the 26 element case.

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@cogsci.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 Thursday, 27 March 2003 09:11:16 UTC