एक्सएमएल स्कीमा सूची तत्व
❮ पूर्ण XML स्कीमा संदर्भ
परिभाषा और उपयोग
सूची तत्व एक साधारण प्रकार के तत्व को एक निर्दिष्ट डेटा प्रकार के मूल्यों की सूची के रूप में परिभाषित करता है।
तत्व जानकारी
- मूल तत्व: सरल प्रकार
वाक्य - विन्यास
<list
id=ID
itemType=QName
any attributes
>
(annotation?,(simpleType?))
</list>
(? चिन्ह यह घोषणा करता है कि तत्व सूची तत्व के अंदर शून्य या एक बार हो सकता है)
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 स्कीमा संदर्भ