Re: Difficult logical relationship in complex type

On 24 Aug 2010, at 11:54 , McBride, David wrote:

> ...
>
> The only remaining problem with the XSD form is that it implies  
> order, but I may have to live with that.


There are two ways to approach that question.

One is to say that since no information is being conveyed by
different ways of ordering the elements, there is no point in
allowing different orders.  On this view, the fact that B, C,
and D can be interleaved is a weakness of the content models
we've been talking about, because it allows both BC and CB
(for example) to convey the same information, thus opening
a covert channel for conveying additional (unauthorized)
information.  The fact that allowing B, C, and D to occur in
any order simplifies the content model expression and makes
it easier to see what's going on may or may not outweigh that
weakness.

The other way is to say that any order should be allowed.
(Perhaps in some application the order does convey information,
but we still want to enforce the constraints we've been
discussing.)  Here the key point seems to be:  A, B, C, and
D can occur as children in any order, and at least one of
B, C, or D must occur, or else nothing at all.  Then we can
write

   (A*, (B|C|D), (A|B|C|D)*)?

Or in XSD syntax

   <sequence minOccurs="0" maxOccurs="1">
     <element ref="A" minOccurs="0" maxOccurs="unbounded">
     <choice>
       <element ref="B"/>
       <element ref="C"/>
       <element ref="D"/>
     </choice>
     <choice minOccurs="0" maxOccurs="unbounded">
       <element ref="A"/>
       <element ref="B"/>
       <element ref="C"/>
       <element ref="D"/>
     </choice>
   </sequence>


-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************

Received on Tuesday, 24 August 2010 19:15:32 UTC