XML Schema notation要素
定義と用法
notation要素はXML文書内の非XMLデータの形式を説明します。
要素情報
出現回数 | 無制限 |
親要素 | schema |
内容 | annotation |
文法
<notation id=ID name=NCName public=anyURI system=anyURI 任意の属性 > (annotation?) </notation>
(?シンボルはnotation要素内で、この要素が0回または1回出現する場合に宣言されます。)
属性 | 説明 |
---|---|
id | オプション。要素のユニークなIDを指定します。 |
name | 必須。要素の名前を指定します。 |
public | 必須。public識別子に対応するURI参照。 |
system | system識別子に対応するURI参照。 |
任意の属性 | オプション。non-schema命名空間を持つ他の属性を指定します。 |
例
例1
以下の例では、view.exeというビューアを使用してgifおよびjpeg形式のnotationを表示する方法を示しています:
<?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>