XML Schema notation ÔªËØ
¶¨ÒåºÍÓ÷¨
notation ÔªËØÃèÊö XML ÎĵµÖÐ·Ç XML Êý¾ÝµÄ¸ñʽ¡£
ÔªËØÐÅÏ¢
| ³öÏÖ´ÎÊý | ÎÞÏÞÖÆ |
| ¸¸ÔªËØ | schema |
| ÄÚÈÝ | annotation |
Óï·¨
<notation id=ID name=NCName public=anyURI system=anyURI any attributes > (annotation?) </notation>
£¨? ·ûºÅÉùÃ÷ÔÚ notation ÔªËØÖиÃÔªËØ¿É³öÏÖÁã´Î»òÒ»´Î¡££©
| ÊôÐÔ | ÃèÊö |
|---|---|
| id | ¿ÉÑ¡¡£¹æ¶¨¸ÃÔªËØµÄΨһµÄ ID¡£ |
| name | ±ØÐè¡£ÎªÔªËØ¹æ¶¨Ãû³Æ¡£ |
| public | ±ØÐè¡£Óë public ±êʶ·ûÏà¶ÔÓ¦µÄ URI ÒýÓᣠ|
| system | Óë system ±êʶ·ûÏà¶ÔÓ¦µÄ URI ÒýÓᣠ|
| any attributes | ¿ÉÑ¡¡£¹æ¶¨´øÓÐ 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>