Name

xs:all

Synopsis

<xs:all
  id = "ID"
  maxOccurs = "1"
  minOccurs = "(0 | 1)">
  <!-- ( xs:annotation?, xs:element* ) -->
</xs:all>

The xs:all element indicates that every element represented by one of its child xs:element elements must appear. However, the order of the child elements in the instance element does not matter. For example, an xs:all element can require that each FullName element have exactly one FirstName child and exactly one LastName child, but that the order of the two child elements does not matter; the first name can come first or the last name can come first.

The xs:all element must be the top group in its content model (i.e., an xs:choice or xs:sequence cannot contain an xs:all element). The complete group represented by the xs:all element can occur either zero or one time as indicated by its minOccurs and maxOccurs attributes. By default, it must occur exactly once. Furthermore, the minOccurs and maxOccurs attributes of each of the individual xs:element elements inside the xs:all element must also be set to either 0 or 1. xs:all cannot indicate, for example, that a FullName element must contain between zero and five FirstNames and between one and three LastNames in any order.

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.