XML Şema listesi Öğesi
❮ Eksiksiz XML Şeması Referansı
Tanım ve Kullanım
Liste öğesi, belirli bir veri türünün değerlerinin bir listesi olarak basit bir tür öğesini tanımlar.
Eleman Bilgileri
- Ana öğeler: simpleType
Sözdizimi
<list
id=ID
itemType=QName
any attributes
>
(annotation?,(simpleType?))
</list>
(? işareti, öğenin liste öğesi içinde sıfır veya bir kez oluşabileceğini bildirir)
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 |
örnek 1
Aşağıdaki örnek, bir tamsayı listesi olan basit bir türü göstermektedir:
<?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>
Not: Beyaz boşluk, liste öğesi ayırıcısı olarak kabul edilir!
Örnek 2
Aşağıdaki örnek, bir dize listesi olan basit bir türü gösterir:
<?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>
❮ Eksiksiz XML Şeması Referansı