Name

xs:union

Synopsis

<xs:union
  id = "ID"
  memberTypes = "List of QName" >
  <!-- (xs:annotation?, (xs:simpleType*)) -->
</xs:union>

The xs:union element is placed inside an xs:simpleType to indicate that an element or attribute can contain any one of multiple types. For example, it can say that an element can contain either an xs:integer or an xs:token. The names of the types that participate in the union are listed in the memberTypes attribute separated by whitespace. Furthermore, the types defined in the xs:simpleType children of the xs:union are also members of the union.

Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.