list
XML Schema list elementi
❮ To‘liq XML Schema ma’lumotnomasi
Ta’rif va qo‘llanilishi
list elementi oddiy tipli elementni ko‘rsatilgan ma’lumot tipidagi qiymatlar ro‘yxati sifatida aniqlaydi.
Element haqida ma’lumot
- Ota elementlar: simpleType
Sintaksis
<list
id=ID
itemType=QName
any attributes
>
(annotation?,(simpleType?))
</list>(? belgisi element list elementi ichida nol yoki bir marta kelishi mumkinligini bildiradi)
| Atribut | Tavsif |
|---|---|
| id | Ixtiyoriy. Element uchun noyob ID belgilaydi |
| itemType |
Ushbu yoki boshqa sxemada aniqlangan o‘rnatilgan ma’lumot tipi yoki simpleType elementining nomini belgilaydi. Agar kontent simpleType elementini o‘z ichiga olsa, bu atributga ruxsat berilmaydi, aks holda u majburiy |
| any attributes | Ixtiyoriy. Sxemaga oid bo‘lmagan nomlar fazosidagi boshqa har qanday atributlarni belgilaydi |
1-misol
Quyidagi misolda butun sonlar ro‘yxatidan iborat oddiy tip ko‘rsatilgan:
<?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>Eslatma: Bo‘sh joy ro‘yxat elementlarini ajratuvchi sifatida qabul qilinadi!
2-misol
Quyidagi misolda stringlar ro‘yxatidan iborat oddiy tip ko‘rsatilgan:
<?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>❮ To‘liq XML Schema ma’lumotnomasi
W3Schools Pathfinder
Yutuqlaringizni kuzating – bu bepul!
