View Single Post
Old 08-20-2002, 09:21 PM   #18
UniDyne
A Tundra Mammoth
 
Join Date: Jul 2002
Server: Veeshan
Posts: 64
Arrow To answer Gendal's questions.

Quote:
Gendal
...it seems elements who inherit a complex type's [elements] are limited to either sequential or choice complexContent...

This is true - that's the way it's supposed to work.

Quote:
W3C Schema Primer
...no element in the content model may appear more than once, i.e. the permissible values of minOccurs and maxOccurs are 0 and 1.

The equivalent of the ? operator in a DTD. This is exactly the behaviour we are looking for. Hard to believe that this is only available for top-level elements... or is it?

What if we used sequence instead of choice?
Quote:
Regarding xsd:sequence
The sequence element specifies that the child elements must appear in a sequence. Each child element can occur from 0 to any number of times.

Sounds exactly like what we want - with one exception: this is the equivalent of the * operator in a DTD, not ?. To correct this, we can simply set the sequence's maxOccurs attribute to 1. As far as I can tell, in most cases, this provides the same functionality that all does in top-level elements.

From everything that I've seen, using sequence is the only choice (no pun intended ). I think it's results will be right on. What were the problems you were having with sequence?
UniDyne is offline   Reply With Quote