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