On Sun, 26 Jan 2003 14:58:57 -0800, in szf you wrote:
>>In doing so, the <sequence> forces the children to be in that specific order.
The RSS document I've been using as an example (yesterday's Scripting News)
doesn't seem to have the <channel> child elements in any particular order, nor
is it mandated by the spec. <sequence> can't be used that way, it won't validate
unless the order is specific.
>>
>>Only <all> can be used to make an arbitrary child order and <all> can't take
any elements other than <element>. Can't use <choice> in it.
>
>the sequence only contains the choice, the choice is set to have
>maxOccurs="unbounded", so that in effect you end up with any number of
>elements from within the choice. I'm obviously not explaining this
>very well, i'll post a sample (after the game, go Raiders!)
>
>Cheers
>Simon
Given this schema
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:element name="foo">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="a"/>
<xs:element name="b"/>
<xs:element name="c"/>
<xs:element name="d"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
The following instance doc is valid (verified with XMLSpy 4.4)
<foo>
<a></a>
<c/>
<c/>
<c/>
<d/>
<a/>
</foo>
Which i believe is what you were looking for.
Cheers
Simon
www.pocketsoap.com