Robert Strauch
Robert Strauch

Reputation: 12906

Choice of complex types in an XSD

In an XML schema can a complex type contain a choice of other complex types? I couldn't find any information about that.

Upvotes: 4

Views: 2304

Answers (1)

Simeon Visser
Simeon Visser

Reputation: 122506

Yes, see section 3.4.2 of the XML Schema reference; a complexType can indeed contain a choice element.

Similarly, a choice element can contain one or more complexType elements (see section 3.8.2).

Upvotes: 3

Related Questions