XML 스키마 complexContent 요소
❮ 완전한 XML 스키마 참조
정의 및 사용
complexContent 요소는 혼합 콘텐츠 또는 요소만 포함하는 복합 유형에 대한 확장 또는 제한을 정의합니다.
요소 정보
- 상위 요소: complexType
통사론
<complexContent
id=ID
mixed=true|false
any attributes
>
(annotation?,(restriction|extension))
</complexContent>
(? 기호는 요소가 complexContent 요소 내에서 0번 또는 1번 발생할 수 있음을 선언합니다.)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
mixed | Optional. Specifies whether character data is allowed to appear between the child elements of this complexType element. Default is false |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
실시예 1
다음 예제에는 세 가지 추가 요소(주소, 도시 및 국가)로 상속된 유형을 확장하여 다른 복합 유형인 "personinfo"에서 파생된 복합 유형 "fullpersoninfo"가 있습니다.
<xs:element name="employee" type="fullpersoninfo"/>
<xs:complexType name="personinfo">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="fullpersoninfo">
<xs:complexContent>
<xs:extension base="personinfo">
<xs:sequence>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
위의 예에서 "employee" 요소는 "firstname", "lastname", "address", "city" 및 "country" 요소를 순서대로 포함해야 합니다.
❮ 완전한 XML 스키마 참조