عنصر notation XML Schema
تعریف و استفاده
عنصر notation XML، توضیح فرمت دادههای غیر XML در مستند XML است.
اطلاعات عنصر
تعداد ظهور | محدودیتها |
عنصر والد | شکست |
محتوای | توضیح |
نحو
<notation id=ID name=NCName public=anyURI system=anyURI ویژگیهای هر > (توضیح?) </notation>
(? نشانهها در عنصر notation میتوانند صفر یا یک بار ظاهر شوند.)
ویژگی | توضیح |
---|---|
id | اختیاری. ID منحصر به فرد عنصر را مشخص میکند. |
name | ضروری. نام عنصر را مشخص میکند. |
public | ضروری. URI مرتبط با شناسه public. |
system | URI مرتبط با شناسه system. |
ویژگیهای هر | اختیاری. هرگونه ویژگی با نام فضای نام non-schema را مشخص میکند. |
مثال
مثال 1
مثال میدهد که از یک برنامه مشاهده view.exe برای نمایش notation با فرمت gif و jpeg استفاده میشود:
<?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>