องค์ประกอบ XML Schema simpleContent
ความหมายและการใช้งาน
องค์ประกอบ simpleContent มีองค์ประกอบ complexType (มัน simpleType องค์ประกอบหรือข้อมูลเนื้อหาตัวอักษร) ขยายหรือ จำกัด และไม่ได้มีองค์ประกอบใด ๆ
องค์ประกอบข้อมูล
- องค์ประกอบหลัก: complexType
ไวยากรณ์
<simpleContent
id=ID
any attributes
>
(annotation?,(restriction|extension))
</simpleContent>
id=ID
any attributes
>
(annotation?,(restriction|extension))
</simpleContent>
(ใช่หรือไม่ลงบอกว่าองค์ประกอบองค์ประกอบ simpleContent สามารถเกิดขึ้นได้เป็นศูนย์หรือเพียงครั้งเดียว.)
属性 | 描述 |
---|---|
id | 可选。规定该元素的唯一的 ID。 |
any attributes | 可选。规定带有 non-schema 命名空间的任何其他属性。 |
ตัวอย่างที่ 1
นี้เป็นองค์ประกอบ XML ที่มีข้อความเท่านั้น (<shoesize>):
<shoesize country="france">35</shoesize>
ตัวอย่างต่อไปนี้ประกาศซับซ้อนพิมพ์ "shoesize" มีเนื้อหาซึ่งถูกกำหนดให้เป็นชนิดข้อมูลจำนวนเต็มและประเทศที่มีแอตทริบิวต์:
<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>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:integer">
<xs:attribute name="country" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
XML Schema สมบูรณ์อ้างอิง