Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XML Schema all Element

XML Schema all Element


XML Schema Reference Manual Complete XML Schema Reference Manual


Definition and Usage

The element specifies that child elements can appear in any order, and each child element can appear zero or one time.

Element Information

Syntax

id=ID

maxOccurs=1

minOccurs=0|1

any attributes

(annotation?,element*)

(The ? symbol declares that the element can appear zero or one time, while the * symbol declares that the element can appear zero or more times in all elements.)

property Description
id Optional. The unique identifier of the element.
maxOccurs Optional. The maximum number of times the element can appear. The value must be 1.
minOccurs Optional. The minimum number of times the element can appear. The value can be the integer 0 or 1. To specify that the element is optional, set this attribute to 0. The default is 1.
any attributes Optional. Specifies any other attributes with a non-schema namespace.

Example 1

  xs:complexType

    xs:all

      

      

    

  

The example above indicates that the "firstname" and "lastname" elements can appear in any order, and both elements must appear exactly once!

Example 2

  xs:complexType

    

      

      

    

  

The example above indicates that the "firstname" and "lastname" elements can appear in any order, and each element can appear zero or one time!


XML Schema Reference Manual Complete XML Schema Reference Manual