XML Schema 参考手册 完整 XML Schema 参考手册 The notation element describes the format of non-XML data in an XML document. 父元素: Schema (? The symbol declares that the element can appear zero or once in the notation element. ) Attribute Description Id Optional. Specifies the unique ID of the element. Name Necessary. Specify a name for the element. Public Necessary. The URI reference that corresponds to the public identifier. System The URI reference that corresponds to the system identifier. Any attributes Optional. Specifies any other attributes with the non-schema namespace. The following example displays notation in gif and jpeg formats by using a view application view.exe:Definition and usage ¶
Element information ¶
Grammar ¶
<notation
id=ID
name=NCName
public=anyURI
system=anyURI
*any attributes*
>
(annotation?)
</notation>
Example 1 ¶
<?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>