XML 스키마 모든 요소
❮ 완전한 XML 스키마 참조
정의 및 사용
all 요소는 하위 요소가 임의의 순서로 나타날 수 있고 각 하위 요소가 0번 또는 1번 나타날 수 있음을 지정합니다.
요소 정보
- 상위 요소: 그룹, complexType, 제한(simpleContent 및 complexContent 모두), 확장(simpleContent 및 complexContent 모두)
통사론
<all
id=ID
maxOccurs=1
minOccurs=0|1
any attributes
>
(annotation?,element*)
</all>
(? 기호는 요소가 0번 또는 1번 발생할 수 있음을 선언하고 * 기호는 요소가 all 요소 내에서 0번 이상 발생할 수 있음을 선언합니다)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
maxOccurs | Optional. Specifies the maximum number of times the element can occur. The value must be 1. |
minOccurs | Optional. Specifies the minimum number of times the element can occur. The value can be 0 or 1. Default value is 1 |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
실시예 1
<xs:element name="person">
<xs:complexType>
<xs:all>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
</xs:all>
</xs:complexType>
</xs:element>
위의 예는 "firstname" 및 "lastname" 요소가 임의의 순서로 나타날 수 있지만 두 요소 모두 한 번만 발생해야 함을 나타냅니다.
실시예 2
<xs:element name="person">
<xs:complexType>
<xs:all>
<xs:element name="firstname" type="xs:string" minOccurs="0"/>
<xs:element name="lastname" type="xs:string" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
위의 예는 "firstname" 및 "lastname" 요소가 임의의 순서로 나타날 수 있고 각 요소가 0 또는 1번 나타날 수 있음을 나타냅니다!
❮ 완전한 XML 스키마 참조