عنصر SimpleType لمخطط XML
❮ مرجع مخطط XML الكامل
التعريف والاستخدام
يعرّف عنصر simpleType نوعًا بسيطًا ويحدد القيود والمعلومات حول قيم السمات أو العناصر النصية فقط.
معلومات العنصر
- العناصر الأصلية: السمة ، العنصر ، القائمة ، التقييد ، المخطط ، الاتحاد
بناء الجملة
<simpleType
id=ID
name=NCName
any attributes
>
(annotation?,(restriction|list|union))
</simpleType>
(تعلن العلامة أن العنصر يمكن أن يحدث صفرًا أو مرة واحدة داخل عنصر simpleType)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
name | Specifies a name for the element. This attribute is required if the simpleType element is a child of the schema element, otherwise it is not allowed |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
مثال 1
يعرّف هذا المثال عنصرًا يسمى "العمر" وهو نوع بسيط له قيد. لا يمكن أن تكون قيمة العمر أقل من 0 أو أكبر من 100:
<xs:element name="age">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
❮ مرجع مخطط XML الكامل