Elemen notation XML Schema
Definisi dan penggunaan
Elemen notation menggambarkan format data non-XML dalam dokumen XML.
Informasi elemen
Kali muncul | Tidak terbatas |
Element induk | schema |
Konten | anotasi |
Syarat
<notation id=ID name=NCName public=anyURI system=anyURI atribut mana pun > (anotasi?) </notation>
Simbol (?) deklarasikan dapat muncul nol atau satu kali di dalam elemen notation.
Atribut | Deskripsi |
---|---|
id | Pilihan. Tentukan ID unik bagi elemen ini. |
name | Diperlukan. Tentukan nama bagi elemen. |
public | Diperlukan. Penggunaan URI yang sejalan dengan penanda public. |
system | Penggunaan URI yang sejalan dengan penanda system. |
atribut mana pun | Pilihan. Tentukan setiap atribut lain dengan non-schema namespace. |
Contoh
Contoh 1
Contoh di bawah ini menggunakan aplikasi penilikkan view.exe untuk menunjukkan format notation 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>
文档中的 "image" 元素是这样的:
<image type="gif"></image>