Skema XML termasuk Elemen
Referensi Skema XML Lengkap
Definisi dan Penggunaan
Elemen include digunakan untuk menambahkan beberapa skema dengan namespace target yang sama ke dokumen.
Informasi Elemen
- Elemen induk: skema
Sintaksis
<include
id=ID
schemaLocation=anyURI
any attributes
>
(annotation?)
</include>
(Tanda ? menyatakan bahwa elemen dapat muncul nol atau satu kali di dalam elemen include)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
schemaLocation | Required. Specifies the URI to the schema to include in the target namespace of the containing schema |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
Contoh 1
Dengan skema yang disertakan, semua file yang disertakan harus merujuk ke namespace target yang sama. Jika namespace target skema tidak cocok, penyertaan tidak akan berfungsi:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.w3schools.com/schema">
<xs:include schemaLocation="https://www.w3schools.com/xml/customer.xsd"/>
<xs:include schemaLocation="https://www.w3schools.com/xml/company.xsd"/>
..
..
..
</xs:schema>
Referensi Skema XML Lengkap