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

Re: Difficult logical relationship in complex type

From: Michael Kay <mike@saxonica.com>
Date: Tue, 24 Aug 2010 09:05:57 +0100
Message-ID: <4C737D65.7080201@saxonica.com>
To: "McBride, David" <dmcbride@quicinc.com>
CC: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
  On 23/08/2010 17:39, McBride, David wrote:
> I'm having difficulties defining a logical relationship within a 
> complex type.  The complex type contains 4 sub-elements.  Let's call 
> them A, B, C, D.  The logical relationship is this:
> 1. One, or more of elements B, C, or D are required.
> 2. There may be zero or more instances of element A.
> 3. Element A may never be the only element.  In other words, there may 
> only be an instance of A, if there is also at least one instance of B, 
> C, or D.
> If I was just dealing with B, C, and D, I could handle that.  However, 
> adding the requirements for A has thrown me.
> Thanks for any responses, in advance.

Are there any ordering constraints?

If not, I would think this is stretching XSD 1.0 to the limits. It's 
obviously easy using XSD 1.1 assertions.

Michael Kay
Received on Tuesday, 24 August 2010 08:06:27 UTC

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