يتضمن مخطط XML عنصرًا
❮ مرجع مخطط XML الكامل
التعريف والاستخدام
يتم استخدام عنصر التضمين لإضافة مخططات متعددة بنفس مساحة الاسم الهدف إلى المستند.
معلومات العنصر
- العناصر الأصلية: المخطط
بناء الجملة
<include
id=ID
schemaLocation=anyURI
any attributes
>
(annotation?)
</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 |
مثال 1
باستخدام المخططات المضمنة ، يجب أن تشير جميع الملفات المضمنة إلى نفس مساحة الاسم الهدف. إذا لم تتطابق مساحة اسم هدف المخطط ، فلن يعمل التضمين:
<?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>
❮ مرجع مخطط XML الكامل