XML Schema simpleContent element

ການອະທິບາຍແລະການນໍາໃຊ້

simpleContent ປະກອບກັນການຂະຫຍາຍຫຼືການການກວດກາ complexType ທີ່ມີຂໍ້ຄວາມຄີເຈັດຫຼື simpleType ແລະບໍ່ມີປະກອບກັນອື່ນໆ。

ຂໍ້ມູນປະກອບກັນ

ຈຳນວນການປະກອບກັນ ຄັ້ງ
ປະກອບກັນພາຍໃນ complexType
ຂອບເຂດ

ການເວົ້າສະຫຼະການທີ່ບໍ່ຕ້ອງການ — annotation

ການເວົ້າສະຫຼະການທີ່ຕ້ອງການ — ມີແລະພຽງພໍດຽວປະກອບກັນລາຍລະອຽດກໍານົດຢູ່ດ້ານຫນັງ: restriction (simpleContent) ຫຼື extension (simpleContent)。

ວິທະຍາສາດ

<simpleContent
id=ID
any attributes
>
(annotation?,(restriction|extension))
</simpleContent>

(? ອີກປະກອບກັນອອກຈາກ simpleContent ທີ່ມີສະນັບຫນັງດຽວຫຼືບໍ່ມີ。)

ຜະສານ ການອະທິບາຍ
id ຄວາມອິດສະຫຼະການ。ກໍານົດ ID ສະນັບຫນັງຂອງປະກອບກັນດັ່ງກ່າວຢ່າງດຽວ。
any attributes ຄວາມອິດສະຫຼະການ。ກໍານົດຜະສານທີ່ມີຫົວຂໍ້ນອກ schema。

ຄວາມລະອຽດ

ຕົວຢ່າງ 1

ນີ້ແມ່ນປະກອບກັນ XML ທີ່ມີຂໍ້ຄວາມພຽງພໍດຽວ (<shoesize>):

<shoesize country="france">35</shoesize>

ບົດຕອນທີ່ລາວສະແດງວ່າການກໍ່ສ້າງຊະນິດ "shoesize" ທີ່ຖືກກໍານົດວ່າມີມະນາການສະໜາດສະເພາະສະເພາະແບບສະເພາະສະເພາະມີບັນດາບັນຊີ country:

<xs:element name="shoesize">
  <xs:complexType>
    <xs:simpleContent>
      <xs:extension base="xs:integer">
        <xs:attribute name="country" type="xs:string" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
</xs:element>