Elemen impor Skema XML
Referensi Skema XML Lengkap
Definisi dan Penggunaan
Elemen impor digunakan untuk menambahkan beberapa skema dengan namespace target yang berbeda ke dokumen.
Informasi Elemen
- Elemen induk: skema
Sintaksis
<import
id=ID
namespace=anyURI
schemaLocation=anyURI
any attributes
>
(annotation?)
</import>
(Tanda ? menyatakan bahwa elemen dapat muncul nol atau satu kali di dalam elemen impor)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
namespace | Optional. Specifies the URI of the namespace to import |
schemaLocation | Optional. Specifies the URI to the schema for the imported namespace |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
Contoh 1
Contoh berikut menunjukkan cara mengimpor namespace:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="https://www.w3schools.com/schema"/>
..
..
..
</xs:schema>
Referensi Skema XML Lengkap