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スキーマリファレンス