Elemen notation XML Schema
Definisi dan penggunaan
Elemen notation menggambarkan format data non-XML dalam dokumen XML.
Informasi elemen
Kali muncul | Tidak terbatas |
Elemen induk | schema |
Konten | anotasi |
Sintaks
<notation id=ID name=NCName publik=anyURI sistem=anyURI properti apapun > (anotasi?) </notation>
Simbol (? ) yang dijelaskan di dalam elemen notation dapat muncul nol atau satu kali.
Properti | Deskripsi |
---|---|
id | Pilihan. Tentukan ID unik bagi elemen ini. |
name | Diperlukan. Tentukan nama bagi elemen ini. |
publik | Diperlukan. Referensi URI yang sejalan dengan penanda publik. |
sistem | Referensi URI yang sejalan dengan penanda sistem. |
properti apapun | Pilihan. Tentukan setiap properti lain yang memiliki ruang nama non-schema. |
Contoh
Contoh 1
Contoh di bawah ini menggunakan aplikasi penilik gambar view.exe untuk menampilkan notation format gif dan 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>
Elemen "image" di dalam dokumen seperti ini:
<image type="gif"></image>