Re: Rationale for restricted uses of "all"

Hi Henry

> > > <snip/>
> > >
> > > > What is really needed is for it to be legal to write something like:
> > > >
> > > > <xs:all>
> > > >   <A minoccurs=0 maxoccurs=unbounded>
> > > >   <B minoccurs=1 maxoccurs=unbounded>
> > > >   <C minoccurs=2 maxoccurs=5>
> > > > </xs:all>
> > > >
> > > > Although xs:nosequence might be more descriptive than xs:all.
> > >
> > > _One_ (not the only) reason in the way of doing this is that the WG
> > > has found that although some people ahve said something like the above
> > > is what they want, they turn out to mean different things by it.
> > >
> > > On _your_ interpretation of the above, would the following be valid:
> > >
> > > <C/><B/><C/>
> > >
> > > ?
> > >
> > > ht
> >
> > Yes, my _requirement_ is that the elements are able to occur in any
order.
> > Only the number of incidences of each is significant (the cases of
> > min=0, max=unbounded and min=1, max=unbounded are the ones my
> > application requires in reality).
>
> That's actually an important observation -- it's in part the
> interaction with numeric maxOccurs and >1 minOccurs that cause
> implementation difficulties.

If you want to talk about the implementation difficulties privately off list
I
would be happy to do so. I might even be able to help.

> > I must be being thick again because I can't see any ambiguity in the
> > above. Could you explain please?
>
> The stricter interpretation is that the same-named elements must occur
> adjacent to one another, so the above would be invalid, but e.g.
>
>  <C/><C/><B/>
> or
>  <B/><C/><C/>
>
> would be OK.

Ah I see now :-) In fact my previous suggestion of allowing xs:all
to have child compositors might be interpreted as covering this
stricter case. The looser (commoner?) case that I want would
require the minOccurs and maxOccurs attributes to be specified
on the child compositors rather than the child elements.

Strict case:

<xs:element name="Discordia">
    <xs:complexType>
        <xs:all>
            <xs:sequence>
                <xs:element name="A" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:sequence>
                <xs:element name="B" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:sequence>
                <xs:element name="C" minOccurs="2" maxOccurs="5"/>
            </xs:sequence>
        </xs:all>
    </xs:complexType>
</xs:element>

Loose case:

<xs:element name="Eris">
    <xs:complexType>
        <xs:all>
            <xs:sequence minOccurs="0" maxOccurs="unbounded">
                <xs:element name="A"/>
            </xs:sequence>
            <xs:sequence maxOccurs="unbounded">
                <xs:element name="B"/>
            </xs:sequence>
            <xs:sequence minOccurs="2" maxOccurs="5">
                <xs:element name="C"/>
            </xs:sequence>
        </xs:all>
    </xs:complexType>
</xs:element>

cheers
Gaz

Received on Wednesday, 21 November 2001 07:47:09 UTC