W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2010

Using xs:all question

From: Hintz, David <david.hintz@siemens.com>
Date: Fri, 12 Feb 2010 12:23:08 -0500
To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-ID: <6344D3A1F3677A429F994D643E17F84F4D93F91054@USCIMMBX001.net.plm.eds.com>

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:all minOccurs="0">
        <xs:element ref="b"/>
        <xs:element ref="c"/>

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.

Received on Friday, 12 February 2010 22:01:40 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:55 UTC