← Prev in month ← Prev in thread

xs:choice question...

From
Brian J Gentry <>
To
Date
2006-01-16T17:35:48Z
ID
<>
Thread
xs:choice question...

Hello,
         I have a schema that needs to require 1 of 2 elements, but also allow for both of them. So if the elements are A & B, then A alone is valid, B alone is valid, A & B are valid, but ~A & ~B is invalid.

I tried the following..

                        <xs:choice>
                         <xs:sequence>
                                        <xs:element name="A" minOccurs="1"/>
                                        <xs:element name="B" minOccurs="0"/>
                         </xs:sequence>
                         <xs:sequence>
                                        <xs:element name="A" minOccurs="0"/>
                                        <xs:element name="B" minOccurs="1"/>
                         </xs:sequence>
                        </xs:choice>

But this is not working as it makes the model non-deterministic.  Is there a way to solve this?

Thanks for your time and kind regards,
Brian Gentry
← Prev in month ← Prev in thread