Re: how does one represent an alternating set of elements?

Sorry John: the all in my last post should of course have been a
sequence.  IE

<?xml version = "1.0" encoding = "UTF-8"?>
<xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema">

  <xsd:element name='A' type='xsd:anyType'/>
  <xsd:element name='B' type='xsd:anyType'/>

  <xsd:element name='seqAB'>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:group ref='seqABgroup' minOccurs='0' maxOccurs='unbounded'/>
        <xsd:element ref='A' minOccurs='0'/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:group name='seqABgroup'>
    <xsd:sequence>
        <xsd:element ref='A'/>
        <xsd:element ref='B'/>
    </xsd:sequence>
  </xsd:group>

</xsd:schema>

regards

Steve

On Fri, 15 Feb 2002, John Utz wrote:

> greetings;
>
> i hope this is trivial for somebody, it's been an absolute hair puller for
> me and some other people.
>
> i am attempting to describe a set of alternating elements:
>
> so, the valid collections of elements would be
>
> A, AB, ABA, ABAB,....
>
> what would *not* be legal would be:
>
> B, BA, AA, ABB, ABAA, BB,....
>
> any help in describing this would be greatly appreciated!
>
> tnx!
>
> johnu
>
>

Received on Saturday, 16 February 2002 09:36:20 UTC