xsd:choice equivalence to individual xsd:elements

Just noticed this in XSD -- an xsd:choice with minOccurs=1 and maxOccurs=unbounded that contains 2 xsd:element(s) each with minOccurs=0 and maxOccurs=1 is roughly equivalent to just having 2 xsd:element(s), each with minOccurs=0 and maxOccurs=unbounded.

The only difference I see is that having the xsd:choice lets you alternate between the xsd:element(s). In many common processing cases (that I've seen), these 2 sub-schemas are completely equivalent.

Leave a comment

About Mark Leighton Fisher

user-pic Perl/CPAN user since 1992.