Schema XML anyAttribute Element
❮ Riferimento completo allo schema XML
Definizione e utilizzo
L'elemento anyAttribute consente all'autore di estendere il documento XML con attributi non specificati dallo schema.
Informazioni sull'elemento
- Elementi principali: complexType, restrizione (sia simpleContent che complexContent), extension (sia simpleContent che complexContent), attributeGroup
Sintassi
<anyAttribute
id=ID
namespace=namespace
processContents=lax|skip|strict
any attributes
>
(annotation?)
</anyAttribute>
(Il segno ? dichiara che l'elemento può verificarsi zero o una volta all'interno dell'elemento 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 |
Esempio 1
L'esempio seguente mostra una dichiarazione per un elemento chiamato "person". Utilizzando l'elemento <anyAttribute> l'autore può aggiungere un numero qualsiasi di attributi all'elemento "person":
<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>
❮ Riferimento completo allo schema XML