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 อ้างอิงที่เกี่ยวข้องกับ public |
system | URI อ้างอิงที่เกี่ยวข้องกับ 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>