XML Schema notation 元素
❮ 完整的 XML Schema 參考
定義和用法
notation 元素描述 XML 文件中非 XML 資料格式。
元素資訊
- 父元素: schema
語法
<notation
id=ID
name=NCName
public=anyURI
system=anyURI
任何屬性
>
(annotation?)
</notation>
(? 符號表示該元素可以在 notation 元素內出現零次或一次)
Attribute | 描述 |
---|---|
id | 可選。指定元素的唯一 ID |
name | 必需。指定元素的名稱 |
公共 | 必需。指定與公共識別符號對應的 URI |
system |
可選。指定與系統識別符號對應的 URI |
任何屬性 | 可選。指定任何其他非 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>
❮ 完整的 XML Schema 參考