Share via

<xsd:all> Element

Allows the elements in the group to appear (or not appear) in any order in the containing element.

  id = ID 
  maxOccurs= 1: 1 
  minOccurs= (0 | 1): 1 
  {any attributes with non-schema Namespace...}>
Content: (annotation?, element*)


  • id
    The ID of this element. The id value must be of type ID and be unique within the document containing this element.


  • maxOccurs
    The maximum number of times the element can occur. The value must be 1.


  • minOccurs
    The minimum number of times the element can occur. The value can be an integer equal to 1. To specify that this element is optional, set this attribute to zero. Default value is 1.


Element Information

Number of occurrences

One time

Parent elements

group, restriction (simpleContent), extension (simpleContent), restriction (complexContent), extension (complexContent), complexType


annotation, element


The following example defines a complex data type containing an all element with three elements for an XML instance documents such as the following example:

<?xml version="1.0"?>
<myElement myAttribute="1.1"> 
    <thing1>for you</thing1>
<xs:element name="thing1" type="xs:string"/>
<xs:element name="thing2" type="xs:string"/>
<xs:element name="thing3" type="xs:string"/>

<xs:attribute name="myAttribute" type="xs:decimal"/>

<xs:complexType name="myComplexType">
  <xs:element ref="thing1"/>
  <xs:element ref="thing2"/>
  <xs:element ref="thing3"/>
 <xs:attribute ref="myAttribute"/>

Other Resources

For more information see the W3C XML Schema Part 1: Structures Recommendation at\#element-all.

See Also


XML Schemas (XSD) Reference
XML Schema Elements