XML Schema นำเข้า Element
❮ การอ้างอิงสคีมา XML ที่สมบูรณ์
ความหมายและการใช้งาน
อิลิเมนต์การนำเข้าใช้เพื่อเพิ่มสคีมาหลายรายการที่มีเนมสเปซเป้าหมายต่างกันในเอกสาร
ข้อมูลองค์ประกอบ
- องค์ประกอบหลัก:สคีมา
ไวยากรณ์
<import
id=ID
namespace=anyURI
schemaLocation=anyURI
any attributes
>
(annotation?)
</import>
(เครื่องหมาย ? ประกาศว่าองค์ประกอบสามารถเกิดขึ้นได้เป็นศูนย์หรือครั้งเดียวภายในองค์ประกอบการนำเข้า)
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 |
ตัวอย่าง 1
ตัวอย่างต่อไปนี้แสดงวิธีการนำเข้าเนมสเปซ:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="https://www.w3schools.com/schema"/>
..
..
..
</xs:schema>
❮ การอ้างอิงสคีมา XML ที่สมบูรณ์