XML Schema notationElement
Vollständiges XML-Schema-Referenzhandbuch
Definition und Verwendung
Das notation-Element beschreibt das Format von Nicht-XML-Daten in einem XML-Dokument.
Elementinformationen
- Übergeordnetes Element: schema
Syntax
<notation
id=ID
name=NCName
public=anyURI
system=anyURI
beliebige Attribute
>
(annotation?)
</notation>
id=ID
name=NCName
public=anyURI
system=anyURI
beliebige Attribute
>
(annotation?)
</notation>
(Das ?-Symbol gibt an, dass dieses Element null- oder einmal innerhalb des notation-Elements vorkommen kann.)
| Attribute | Beschreibung |
|---|---|
| id | Optional. Gibt eine eindeutige ID für das Element an. |
| name | Erforderlich. Gibt einen Namen für das Element an. |
| public | Erforderlich. Eine URI-Referenz, die dem öffentlichen Bezeichner entspricht. |
| system | Eine URI-Referenz, die dem Systembezeichner entspricht. |
| beliebige Attribute | Optional. Gibt beliebige andere Attribute mit einem Nicht-Schema-Namespace an. |
Beispiel 1
Das folgende Beispiel zeigt die Notation für die Formate gif und jpeg unter Verwendung einer Anzeigeanwendung view.exe:
<?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>
Das "image"-Element im Dokument sieht so aus:
<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>
Das "image"-Element im Dokument sieht so aus:
Vollständiges XML-Schema-Referenzhandbuch Weitere Erweiterungen