notation องค์ประกอบ XML Schema
การกำหนดและการใช้งาน
notation องค์ประกอบ ใช้เพื่ออธิบายรูปแบบของข้อมูลที่ไม่ใช่ XML ในเอกสาร XML.
ข้อมูลองค์ประกอบ
ครั้งที่ปรากฏ | ไม่จำกัด |
องค์ประกอบพ่อ | schema |
เนื้อหา | annotation |
ภาษา
<notation id=ID name=NCName public=anyURI system=anyURI คุณสมบัติอื่น > (annotation?) </notation>
(? สัญญาณปรากฏใน notation องค์ประกอบ อาจปรากฏเป็น 0 หรือ 1 ครั้ง。)
คุณสมบัติ | คำอธิบาย |
---|---|
id | ตัวเลือกอย่าง. กำหนด ID ที่เป็นเดียวเดียวสำหรับองค์ประกอบ. |
name | จำเป็น. กำหนดชื่อสำหรับองค์ประกอบ. |
public | จำเป็น. URI อ้างอิงที่สัมพันธ์กับ identifier ของ public. |
system | URI อ้างอิงที่สัมพันธ์กับ identifier ของ system. |
คุณสมบัติอื่น | ตัวเลือกอย่าง. กำหนดคุณสมบัติอื่นที่มีชื่อชิ้นแบบ non-schema. |
ตัวอย่าง
ตัวอย่าง 1
ตัวอย่างดังนี้ ผ่านการใช้โปรแกรมตรวจสอบ view.exe เพื่อแสดง notation รูปภาพที่มีฟอร์แมต gif และ jpeg:
<?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:notation name="gif" public="image/gif" system="view.exe"/> <xs:notation name="jpeg" public="image/jpeg" system="view.exe"/> <xs:element name="image"> <xs:complexType> <xs:simpleContent> <xs:attribute name="type"> <xs:simpleType> <xs:restriction base="xs:NOTATION"> <xs:enumeration value="gif"/> <xs:enumeration value="jpeg"/> <xs:restriction> </xs:simpleType> </xs:attribute> </xs:simpleContent> </xs:complexType> </xs:element> </xs:schema>
องค์ประกอบ "image" ในเอกสารนี้เป็นเช่นนี้:
<image type="gif"></image>