مخطط XML anyAttribute Element
❮ مرجع مخطط XML الكامل
التعريف والاستخدام
يتيح عنصر anyAttribute للكاتب إمكانية توسيع مستند XML بسمات لم يحددها مخطط قاعدة البيانات.
معلومات العنصر
- العناصر الأصلية: نوع مركب ، تقييد (محتوى بسيط ومحتوى معقد) ، امتداد (محتوى بسيط ومحتوى معقد) ، مجموعة سمات
بناء الجملة
<anyAttribute
id=ID
namespace=namespace
processContents=lax|skip|strict
any attributes
>
(annotation?)
</anyAttribute>
(تعلن العلامة أن العنصر يمكن أن يحدث صفرًا أو مرة واحدة داخل أي عنصر سمة)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
namespace | Optional. Specifies the namespaces containing the
attributes
that can be used. Can be set to one of the following:
|
processContents | Optional. Specifies how the XML processor should handle
validation against the elements specified by this any element. Can be set to
one of the following:
|
any attributes | Optional. Specifies any other attributes with non-schema namespace |
مثال 1
يوضح المثال التالي تصريحًا لعنصر يسمى "شخص". باستخدام عنصر <anyAttribute> ، يمكن للمؤلف إضافة أي عدد من السمات إلى عنصر "الشخص":
<xs:element name="person">
<xs:complexType>
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
</xs:element>
❮ مرجع مخطط XML الكامل