A union is a combination of one or more atomic or list types that map to one simple type in an XML file. When you define a union type, you specify what types to combine. For example, you might create a type called size. Size can include string data, such as S, M, and L, or size might contain decimal sizes, such as 30, 32, and 34. If you define a union type element, the XML file can include a sizename type for string sizes, and a sizenum type for numeric sizes.
The following figure shows a schema file containing a shoesize union that contains sizenames and sizenums lists:
Sizename is a restricted string type.
The sizenames type accepts a list of strings.
The sizenums type accepts a list decimals.
The shoesize union accepts both the decimal and string lists.
The union defines sizenames and sizenums as union member types. Sizenames defines a list of string values. Sizenums defines a list of decimal values.