문자 데이터를 가진 complexType 요소나 simpleType 요소에 대한 확장 또는 제한을 내용으로 포함하며 요소는 포함하지 않습니다.
<simpleContent
id = ID
{any attributes with non-schema Namespace}...>
Content: (annotation?, (restriction | extension))
</simpleContent>
특성
id
이 요소의 ID입니다. id 값은 ID 형식이어야 하며 이 요소를 포함하는 문서 내에서 고유한 값이어야 합니다.선택적 항목입니다.
요소 정보
발생 횟수 |
한 번 |
부모 요소 |
|
내용 |
선택적 요소 - annotation 필요한 요소 - restriction (simpleContent) 또는 extension (simpleContent) 요소 중 단 하나입니다. |
주의
simpleContent 요소를 사용하면 요소가 없는 simpleType을 포함하는 것으로 요소를 지정할 수 있으며 요소 내용 값을 제한하거나 특성으로 요소를 확장할 수 있습니다. 예를 들어, 다음 요소 선언에서는 sizing과 같은 특성을 추가할 수 없습니다.
<xs:element name="shoeSize" type="xs:decimal"/>
예제
다음 요소 선언은 simpleContent 요소를 사용하여 요소 내용을 sizing이라는 단일 특성을 가진 decimal 형식으로 정의하는 complexType 요소를 포함합니다.
<xs:element name="shoeSize">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="sizing">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="US"/>
<xs:enumeration value="European"/>
<xs:enumeration value="UK"/>
<xs:enumeration value="Japan"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
설명
단순 내용은 다음 방법 중 하나로 정의해야 합니다.
restriction 요소 |
요소에 대한 값 범위를 상속된 simpleType 값의 하위 집합으로 제한합니다. |
extension 요소 |
특성을 추가하여 요소의 simpleType 내용을 확장합니다. |
예제
다음 예제에서는 내용이 decimal 데이터 형식과 currency 특성으로 정의되고 익명의 complexType을 사용하여 선언된 generalPrice 요소를 보여 줍니다.
<xs:element name="generalPrice">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="currency" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
관련 자료
자세한 내용은 www.w3.org/TR/2001/REC-xmlschema-1-20010502/\#element-all에 있는 Structures Recommendation을 참조하십시오.