XML Schema all
Element
Definition and Usage
The element specifies that the child elements can appear in any order, and each child element can occur zero or one time.
Element Information
- Parent elements: group, complexType, restriction (both simpleContent and complexContent), extension (both simpleContent and complexContent)
Syntax
(? symbol declares that the element can occur zero or one time, while * symbol declares that the element can occur zero or multiple times in all elements.)
Attribute | Description |
---|---|
id | Optional. A unique identifier for the element. |
maxOccurs | Optional. The maximum number of times the element can occur. The value must be 1. |
minOccurs | Optional. The minimum number of times the element can occur. The value can be an integer 0 or 1. To specify that the element is optional, set this attribute to 0. The default value is 1. |
any attributes | Optional. Specifies any other attributes with non-schema namespaces. |
Example 1
The above example indicates that the "firstname" and "lastname" elements can appear in any order, and both elements must occur exactly once!
Example 2
The above example indicates that the "firstname" and "lastname" elements can appear in any order, and each element can occur zero or one time!