Element XML Schema notation
Definicja i użycie
Element notation opisuje format danych nie-XML w dokumencie XML.
Informacje o elemencie
Liczba wystąpień | Bez ograniczeń |
Rodzic | Schema |
Zawartość | przypis |
Gramatyka
<notation id=ID name=NCName public=anyURI system=anyURI Każde atrybuty > (przypis?) </notation>
(? znak deklaracji w elemencie notation może występować zero lub jeden raz。)
Atrybuty | Opis |
---|---|
id | Opcjonalne. Określa unikalny ID elementu. |
name | Wymagane. Określa nazwę elementu. |
public | Wymagane. URI odnoszący się do identyfikatora public. |
system | URI odnoszący się do identyfikatora system. |
Każde atrybuty | Opcjonalne. Określa inne atrybuty z non-schema命名空间。 |
Przykład
Przykład 1
Poniżej znajduje się przykład użycia aplikacji przeglądającej view.exe do wyświetlania formatów notacji 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>