XML Schema termasuk elemen
Definisi dan Penggunaan
termasuk elemen digunakan untuk menambahkan beberapa skema dengan target namespace yang sama untuk dokumen.
Informasi elemen
- elemen induk: skema
tatabahasa
<include
id=ID
schemaLocation=anyURI
any attributes
>
(annotation?)
</include>
id=ID
schemaLocation=anyURI
any attributes
>
(annotation?)
</include>
(? Masuk menyatakan bahwa meliputi unsur, elemen dapat terjadi nol atau satu.)
属性 | 描述 |
---|---|
id | 可选。规定该元素的唯一的 ID。 |
schemaLocation | 必需。规定在包含 schema 的目标命名空间中,要包括的 schema 的 URI。 |
any attributes | 可选。规定带有 non-schema 命名空间的任何其他属性。 |
contoh 1
Dengan disertakan dalam skema, file harus disertakan dalam semua referensi untuk target namespace yang sama. Jika skema sasaran namespace tidak cocok, itu tidak akan efektif meliputi:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.w3cschool.cc/schema">
<xs:include schemaLocation="http://www.w3cschool.cc/schema/customer.xsd"/>
<xs:include schemaLocation="http://www.w3cschool.cc/schema/company.xsd"/>
..
..
..
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.w3cschool.cc/schema">
<xs:include schemaLocation="http://www.w3cschool.cc/schema/customer.xsd"/>
<xs:include schemaLocation="http://www.w3cschool.cc/schema/company.xsd"/>
..
..
..
</xs:schema>
Lengkap XML Schema Referensi