Phần tử ký hiệu lược đồ XML
❮ Tham chiếu lược đồ XML hoàn chỉnh
Định nghĩa và Cách sử dụng
Phần tử ký hiệu mô tả định dạng của dữ liệu không phải XML trong tài liệu XML.
Thông tin phần tử
- Phần tử chính: giản đồ
Cú pháp
<notation
id=ID
name=NCName
public=anyURI
system=anyURI
any attributes
>
(annotation?)
</notation>
(Dấu? Khai báo rằng phần tử có thể xuất hiện 0 hoặc một lần bên trong phần tử ký hiệu)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
name | Required. Specifies a name for the element |
public | Required. Specifies a URI corresponding to the public identifier |
system |
Optional. Specifies a URI corresponding to the system identifier |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
ví dụ 1
Ví dụ sau cho thấy một gif và ký hiệu jpeg bằng cách sử dụng ứng dụng trình xem, view.exe:
<?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>
The "image" element in a document could look like this:
<image type="gif"></image>
❮ Tham chiếu lược đồ XML hoàn chỉnh