XML Şeması anyAttribute Öğesi
❮ Eksiksiz XML Şeması Referansı
Tanım ve Kullanım
AnyAttribute öğesi, yazarın XML belgesini şema tarafından belirtilmeyen niteliklerle genişletmesini sağlar.
Eleman Bilgileri
- Ana öğeler: ComplexType, kısıtlama (hem simpleContent hem de ComplexContent), uzantı (hem simpleContent hem de ComplexContent), nitelikGroup
Sözdizimi
<anyAttribute
id=ID
namespace=namespace
processContents=lax|skip|strict
any attributes
>
(annotation?)
</anyAttribute>
(? işareti, öğenin anyAttribute öğesi içinde sıfır veya bir kez oluşabileceğini bildirir)
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 |
örnek 1
Aşağıdaki örnek, "person" adlı bir öğe için bir bildirimi gösterir. <anyAttribute> öğesini kullanarak yazar, "person" öğesine herhangi bir sayıda nitelik ekleyebilir:
<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>
❮ Eksiksiz XML Şeması Referansı