Download Delve® SOA Fast-Prototyping Toolkit (Beta 1.0)
| Tutorials - How To Use an XML-Schema “Choice” |
Page 1 of 1 |
Sibling elements are most often arranged in sequence—that is, there are a certain set of elements that are always present, and always present in the same order. Sometimes, however, we want to be able to define a type that includes one of several elements rather than all of them. This lesson describes how to go about using the “choice” mechanism.
To define a “choice” use the keyword “choice” followed by definitions for the members in that set.

The sample code defines a type with a choice containing three different members. This means that instance of the type “abc” will always have one child elment—“e,” “f,” or “g.”
|
|
|