RE: Using xs:all question

Can't be done this way in XSD 1.0. The classic solution is to write the
model as ( bc? | cb? ), which of course expands exponentially if there are
more than two possible children.
 
Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


  _____  

From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On
Behalf Of Hintz, David
Sent: 12 February 2010 17:23
To: xmlschema-dev@w3.org
Subject: Using xs:all question



Hi,

 

I want to define an element <a> that allows <b> or <c> in any order.
Elements <b> and <c> are both optional, but <a> cannot be empty (requires at
least one of <b> or <c>).

 

I thought this would work, but no joy (insists that both <b> and <c> are
required) with Arbortext Editor:

 

  <xs:element name="a">

    <xs:complexType>

      <xs:all minOccurs="0">

        <xs:element ref="b"/>

        <xs:element ref="c"/>

      </xs:all>

    </xs:complexType>

  </xs:element>

 

Is there an easy way to do what I want using <xs:all>?  I know how to do it
otherwise, but <xs:all> seems much more elegant.

 

Dave

 

Received on Friday, 12 February 2010 22:44:32 UTC