Element notation w XML Schema
Definicja i użycie
Element notation opisuje format danych ni(XML) w dokumencie XML.
Informacje o elemencie
Częstotliwość występowania | Bez ograniczeń |
Rodzic | schema |
Zawartość | annotacja |
Gramatyka
<notation id=ID name=NCName public=anyURI system=anyURI Jakiekolwiek atrybuty > ( annotacja?) </notation>
(? Symbol deklaracji znajduje się w elemencie notation, który może występować zero lub jeden raz.)
Atrybut | Opis |
---|---|
id | Opcjonalne. Określa unikalny ID elementu. |
name | Wymagane. Określa nazwę elementu. |
public | Wymagane. URI odniesienia odpowiadające identyfikatorowi public. |
system | URI odniesienia odpowiadające identyfikatorowi system. |
Jakiekolwiek atrybuty | Opcjonalne. Określa inne atrybuty z non-schema namespace. |
Przykład
Przykład 1
Poniżej znajduje się przykład, który pokazuje, jak użyć aplikacji do przeglądania view.exe do wyświetlania formatów notation: gif i 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>
Element "image" w dokumencie wygląda tak:
<image type="gif"></image>