XML 스키마 목록 요소
❮ 완전한 XML 스키마 참조
정의 및 사용
list 요소는 단순 유형 요소를 지정된 데이터 유형의 값 목록으로 정의합니다.
요소 정보
- 상위 요소: simpleType
통사론
<list
id=ID
itemType=QName
any attributes
>
(annotation?,(simpleType?))
</list>
(? 기호는 요소가 목록 요소 내에서 0번 또는 1번 발생할 수 있음을 선언합니다)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
itemType |
Specifies the name of a built-in data type or simpleType element defined in this or another schema. This attribute is not allowed if the content contains a simpleType element, otherwise it is required |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
실시예 1
다음 예는 정수 목록인 단순 유형을 보여줍니다.
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="intvalues" type="valuelist"/>
<xs:simpleType name="valuelist">
<xs:list itemType="xs:integer"/>
</xs:simpleType>
</xs:schema>
The "intvalues" element in a document could look like this (notice that
the list will have five list items):
<intvalues>100 34 56 -23 1567</intvalues>
참고: 공백은 목록 항목 구분 기호로 처리됩니다!
실시예 2
다음 예는 문자열 목록인 단순 유형을 보여줍니다.
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="stringvalues" type="valuelist"/>
<xs:simpleType name="valuelist">
<xs:list itemType="xs:string"/>
</xs:simpleType>
</xs:schema>
The "stringvalues" element in a document could look like this (notice
that the list will have four list items):
<stringvalues>I love XML Schema</stringvalues>
❮ 완전한 XML 스키마 참조