Re: xsd:all limitations [was: LC-16 ( LC-132 ): Allow arbitrary order with occurrence > 1]

At 2000-10-18 01:35, Eric van der Vlist wrote:

 >  Occurrence <=1 is only one of the limitations of the all particle
 > and I'd like to submit a real case where we're stuck by these
 > limitations.

 > In our RSS 1.0 proposal [1] we've described a mechanism to define
 > "modules" using different namespaces which can add their own
 > elements within our "core" vocabulary.

 > Our problem is that we won't we able to define the order in which
 > the modules will be specified nor the relative order in which they
 > will appear in the core elements.

 > If we define the channel element, for instance, as:

[example deleted]

 > I am specifying the relative order between the elements from the
 > "dc" and "rss091" modules which isn't acceptable for us.

 > The "natural" solution would be to include the 2 module groups in a
 > xsd:all:
 >
 > <xsd:element name="channel" content="elementOnly">
 >  <xsd:complexType>
 >   <xsd:sequence>
 >    <xsd:element name="title" type="xsd:string"/>
 >    <xsd:element name="link" type="xsd:uriReference"/>
 >  .../...
 >    <xsd:all>
 >     <xsd:group ref="rss091:inChannel" minOccurs="0"/>
 >     <xsd:group ref="dc:dcElements" minOccurs="0"/>
 >    </xsd:all>
 >   </xsd:sequence>
 >   <xsd:attribute ref="rdf:about"/>
 >  </xsd:complexType>
 > </xsd:element>
 >
 > but this isn't possible since xsd:all here would not be a top level
 > container and wouldn't include individual elements.
 >
 > Does anyone have any idea of solutions or workarounds for this kind of
 > situations ?

Since you don't have minimum numbers of occurrences, and don't
want to constrain the order, is there anything wrong with

  <xsd:element name="channel" content="elementOnly">
   <xsd:complexType>
    <xsd:sequence>
     <xsd:element name="title" type="xsd:string"/>
     <xsd:element name="link" type="xsd:uriReference"/>
   .../...
     <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:group ref="rss091:inChannel" minOccurs="0"/>
      <xsd:group ref="dc:dcElements" minOccurs="0"/>
     </xsd:choice>
    </xsd:sequence>
    <xsd:attribute ref="rdf:about"/>
   </xsd:complexType>
  </xsd:element>

I.e. a repeating OR group?

-C M Sperberg-McQueen

Received on Wednesday, 20 December 2000 09:34:34 UTC