XML Schema notation-element
Definition og brug
notation-elementet beskriver formatet for ikke-XML-data i XML-dokumentet.
Elementinformation
Antal forekomster | Ubegrænset |
Forældrelement | schema |
Indhold | notation |
Syntaks
<notation id=ID navn=NCName public=anyURI system=anyURI Enhver attribut > (notation?) </notation>
(? Symbolerklæringen i notationselementet kan forekomme nul eller én gang。)
Egenskab | Beskrivelse |
---|---|
id | Valgfri. Angiver et unikt ID for elementet. |
navn | Obligatorisk. Angiver navnet på elementet. |
public | Obligatorisk. URI-referencen, der svarer til public-identifikatoren. |
system | URI-referencen, der svarer til system-identifikatoren. |
Enhver attribut | Valgfri. Angiver hvilke andre attributter, der kan have en non-schema navnespace. |
Eksempel
Eksempel 1
Dette eksemplet viser, hvordan en visningsapplikation view.exe bruges til at vise notationer i gif- og jpeg-format:
<?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>
Dokumentets "image" element er som følger:
<image type="gif"></image>